From 4a11293f3fccf103f8b8178b333e34638816b67a Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Mon, 23 Oct 2023 10:47:46 +1000 Subject: [PATCH 01/20] add config case class --- src/main/scala/Main.scala | 18 +++---- src/main/scala/translating/IRToBoogie.scala | 9 ++-- src/main/scala/util/BASILConfig.scala | 21 ++++++++ src/main/scala/util/RunUtils.scala | 50 +++++++++++-------- .../scala/MemoryRegionAnalysisMiscTest.scala | 19 ++++--- 5 files changed, 78 insertions(+), 39 deletions(-) create mode 100644 src/main/scala/util/BASILConfig.scala diff --git a/src/main/scala/Main.scala b/src/main/scala/Main.scala index c7184fa7f..6ce2d8a7e 100644 --- a/src/main/scala/Main.scala +++ b/src/main/scala/Main.scala @@ -23,7 +23,7 @@ object Main { @arg(name = "spec", short = 's', doc = "BASIL specification file.") specFileName: Option[String], @arg(name = "output", short = 'o', doc = "Boogie output destination file.") - outFileName: String = "boogie_out.bpl", + outFileName: String = "basil-out", @arg(name = "verbose", short = 'v', doc = "Show extra debugging logs.") verbose: Flag, @arg(name = "analyse", doc = "Run static analysis pass.") @@ -57,15 +57,15 @@ object Main { Logger.setLevel(LogLevel.DEBUG) } - val program: BProgram = RunUtils.loadAndTranslate( - conf.adtFileName, - conf.relfFileName, - conf.specFileName, - conf.analyse.value, - conf.interpret.value, - conf.dumpIL.value + val q = BASILConfig( + loading = ILLoadingConfig(conf.adtFileName, conf.relfFileName, conf.specFileName, conf.dumpIL.value), + runInterpret = conf.interpret.value, + staticAnalysis = if (conf.analyse.value) then Some(StaticAnalysisConfig(conf.dumpIL.value)) else None, + boogieTranslation = BoogieGeneratorConfig(), + outputPrefix = conf.outFileName ) - RunUtils.writeToFile(program, conf.outFileName) + + val program: BProgram = RunUtils.loadAndTranslate(q); } } diff --git a/src/main/scala/translating/IRToBoogie.scala b/src/main/scala/translating/IRToBoogie.scala index bc6d6addb..e7a03d08e 100644 --- a/src/main/scala/translating/IRToBoogie.scala +++ b/src/main/scala/translating/IRToBoogie.scala @@ -1,7 +1,8 @@ package translating -import ir._ -import boogie._ -import specification._ +import ir.* +import boogie.* +import specification.* +import util.BoogieGeneratorConfig import scala.collection.mutable.ArrayBuffer @@ -32,7 +33,7 @@ class IRToBoogie(var program: Program, var spec: Specification) { BVariable("Gamma_R" + 31, BoolBType, Scope.Global) ) - def translate: BProgram = { + def translate(boogieGeneratorQuirks: BoogieGeneratorConfig): BProgram = { val readOnlyMemory = memoryToCondition(program.readOnlyMemory) val procedures = program.procedures.map(f => translateProcedure(f, readOnlyMemory)) val defaultGlobals = List(BVarDecl(mem), BVarDecl(Gamma_mem)) diff --git a/src/main/scala/util/BASILConfig.scala b/src/main/scala/util/BASILConfig.scala new file mode 100644 index 000000000..41fab7aeb --- /dev/null +++ b/src/main/scala/util/BASILConfig.scala @@ -0,0 +1,21 @@ +package util + +/** + * We use 'quirks' to manage the operation mode of the tool e.g. for a-b testing or compiler options. + */ + + +case class ILLoadingConfig(adtFile: String, relfFile: String, specFile: Option[String], dumpIL: Boolean) +case class BoogieGeneratorConfig(memoryFunctionType: BoogieMemoryAccessMode = BoogieMemoryAccessMode.SuccessiveStoreSelect) +case class StaticAnalysisConfig(dumpILEveryPhase: Boolean = false) +enum BoogieMemoryAccessMode: + case SuccessiveStoreSelect, LambdaStoreSelect + +case class BASILConfig( + loading: ILLoadingConfig, + runInterpret: Boolean = false, + staticAnalysis: Option[StaticAnalysisConfig] = None, + boogieTranslation: BoogieGeneratorConfig = BoogieGeneratorConfig(), + outputPrefix: String + ) + diff --git a/src/main/scala/util/RunUtils.scala b/src/main/scala/util/RunUtils.scala index 47832025f..ebe602881 100644 --- a/src/main/scala/util/RunUtils.scala +++ b/src/main/scala/util/RunUtils.scala @@ -62,23 +62,29 @@ object RunUtils { } } + def run(q: BASILConfig): Unit = { + Logger.info("[!] Writing file...") + val boogieProgram = loadAndTranslate(q) + RunUtils.writeToFile(boogieProgram, q.outputPrefix + ".bpl") + } + def loadAndTranslate( - BAPFileName: String, - readELFFileName: String, - specFileName: Option[String], - performAnalysis: Boolean, - performInterpret: Boolean, - dumpIL: Boolean + q: BASILConfig ): BProgram = { - val bapProgram = loadBAP(BAPFileName) - - val (externalFunctions, globals, globalOffsets, mainAddress) = loadReadELF(readELFFileName) + /** + * Loading phase + */ + val bapProgram = loadBAP(q.loading.adtFile) + val (externalFunctions, globals, globalOffsets, mainAddress) = loadReadELF(q.loading.relfFile) val IRTranslator = BAPToIR(bapProgram, mainAddress) var IRProgram = IRTranslator.translate - val specification = loadSpecification(specFileName, IRProgram, globals) + val specification = loadSpecification(q.loading.specFile, IRProgram, globals) + /** + * Analysis Phase + */ Logger.info("[!] Removing external function calls") // Remove external function references (e.g. @printf) val externalNames = externalFunctions.map(e => e.name) @@ -87,16 +93,18 @@ object RunUtils { IRProgram = externalRemover.visitProgram(IRProgram) IRProgram = renamer.visitProgram(IRProgram) - if (dumpIL) { - dump_file(serialiseIL(IRProgram), "before-analysis.il") + if (q.loading.dumpIL) { + dump_file(serialiseIL(IRProgram), q.outputPrefix + "-before-analysis.il") } - if (performAnalysis) { - iterations += 1; - IRProgram = analyse(IRProgram, externalFunctions, globals, globalOffsets) - if (dumpIL) { - dump_file(serialiseIL(IRProgram), "after-analysis.il") + q.staticAnalysis match { + case Some(analysisConfig) => { + IRProgram = analyse(IRProgram, externalFunctions, globals, globalOffsets) + if (analysisConfig.dumpILEveryPhase) { + dump_file(serialiseIL(IRProgram), q.outputPrefix + "-after-analysis.il") + } } + case None => {} } IRProgram.determineRelevantMemory(globalOffsets) @@ -106,7 +114,7 @@ object RunUtils { val specModifies = specification.subroutines.map(s => s.name -> s.modifies).toMap IRProgram.setModifies(specModifies) - if (performInterpret) { + if (q.runInterpret) { val interpreter = Interpreter() interpreter.interpret(IRProgram) } @@ -114,7 +122,9 @@ object RunUtils { Logger.info("[!] Translating to Boogie") val boogieTranslator = IRToBoogie(IRProgram, specification) Logger.info("[!] Done! Exiting...") - boogieTranslator.translate + val boogieProgram = boogieTranslator.translate(q.boogieTranslation) + boogieProgram + } def analyse( @@ -347,7 +357,7 @@ object RunUtils { } def dump_file(content: String, name: String): Unit = { - val outFile = new File(s"${name}.txt") + val outFile = new File(name) val pw = new PrintWriter(outFile, "UTF-8") pw.write(content) pw.close() diff --git a/src/test/scala/MemoryRegionAnalysisMiscTest.scala b/src/test/scala/MemoryRegionAnalysisMiscTest.scala index 9d1679357..be9695216 100644 --- a/src/test/scala/MemoryRegionAnalysisMiscTest.scala +++ b/src/test/scala/MemoryRegionAnalysisMiscTest.scala @@ -3,6 +3,7 @@ import org.scalatest.Inside.inside import org.scalatest.* import org.scalatest.funsuite.* import util.RunUtils +import util.{BASILConfig, ILLoadingConfig, BoogieGeneratorConfig, StaticAnalysisConfig, BoogieMemoryAccessMode} import java.io.{File, OutputStream, PrintStream, PrintWriter} class MemoryRegionAnalysisMiscTest extends AnyFunSuite with OneInstancePerTest { @@ -16,12 +17,18 @@ class MemoryRegionAnalysisMiscTest extends AnyFunSuite with OneInstancePerTest { var actual = "" var output: Map[CfgNode, Set[MemoryRegion]] = Map() RunUtils.loadAndTranslate( - examplesPath + s"${name}/${name}.adt", - examplesPath + s"${name}/${name}.relf", - None, - true, - false, - false + BASILConfig( + loading = ILLoadingConfig( + adtFile = examplesPath + s"${name}/${name}.adt", + relfFile = examplesPath + s"${name}/${name}.relf", + specFile = None, + dumpIL = false + ), + runInterpret = false, + staticAnalysis = Some(StaticAnalysisConfig()), + boogieTranslation = BoogieGeneratorConfig(), + outputPrefix = "boogie_out", + ) ) try { // create dump folder if it does not exist From 805e596eb1c596760c67493eadfa7d0dec61b467 Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Mon, 23 Oct 2023 14:20:52 +1000 Subject: [PATCH 02/20] add IL to expected --- build.sbt | 10 ++++-- src/main/scala/Main.scala | 8 ++--- src/main/scala/util/BASILConfig.scala | 4 +-- src/main/scala/util/RunUtils.scala | 35 +++++-------------- .../scala/MemoryRegionAnalysisMiscTest.scala | 2 +- src/test/scala/SystemTests.scala | 5 +-- 6 files changed, 27 insertions(+), 37 deletions(-) diff --git a/build.sbt b/build.sbt index a196b3a09..66d91e7d3 100644 --- a/build.sbt +++ b/build.sbt @@ -45,14 +45,20 @@ updateExpected := { val name = e.getName val outPath = v / (name + ".bpl") val expectedPath = v / (name + ".expected") + val ILOutPath = v / (name + "-before-analysis.il") + val ILExpectedPath = v / (name + "-before-analysis.il.expected") val resultPath = v / (name + "_result.txt") if (resultPath.exists()) { val result = IO.read(resultPath) val verified = result.strip().equals("Boogie program verifier finished with 0 errors") - if (verified == shouldVerify && outPath.exists()) { - if (!expectedPath.exists() || !compareFiles(outPath, expectedPath)) { + if (verified == shouldVerify) { + if (outPath.exists() && !(expectedPath.exists() || compareFiles(outPath, expectedPath))) { IO.copyFile(outPath, expectedPath) } + if (ILOutPath.exists() && !(ILExpectedPath.exists() || compareFiles(ILExpectedPath, ILOutPath))) { + IO.copyFile(ILOutPath, ILExpectedPath) + } + } } } } diff --git a/src/main/scala/Main.scala b/src/main/scala/Main.scala index 6ce2d8a7e..3ce075bd9 100644 --- a/src/main/scala/Main.scala +++ b/src/main/scala/Main.scala @@ -31,7 +31,7 @@ object Main { @arg(name = "interpret", doc = "Run BASIL IL interpreter.") interpret: Flag, @arg(name = "dump-il", doc = "Dump the Intermediate Language to text.") - dumpIL: Flag, + dumpIL: Option[String], @arg(name = "help", short = 'h', doc = "Show this help message.") help: Flag ) @@ -58,14 +58,14 @@ object Main { } val q = BASILConfig( - loading = ILLoadingConfig(conf.adtFileName, conf.relfFileName, conf.specFileName, conf.dumpIL.value), + loading = ILLoadingConfig(conf.adtFileName, conf.relfFileName, conf.specFileName, conf.dumpIL), runInterpret = conf.interpret.value, - staticAnalysis = if (conf.analyse.value) then Some(StaticAnalysisConfig(conf.dumpIL.value)) else None, + staticAnalysis = if (conf.analyse.value) then Some(StaticAnalysisConfig(conf.dumpIL)) else None, boogieTranslation = BoogieGeneratorConfig(), outputPrefix = conf.outFileName ) - val program: BProgram = RunUtils.loadAndTranslate(q); + RunUtils.run(q); } } diff --git a/src/main/scala/util/BASILConfig.scala b/src/main/scala/util/BASILConfig.scala index 41fab7aeb..2fadae26e 100644 --- a/src/main/scala/util/BASILConfig.scala +++ b/src/main/scala/util/BASILConfig.scala @@ -5,9 +5,9 @@ package util */ -case class ILLoadingConfig(adtFile: String, relfFile: String, specFile: Option[String], dumpIL: Boolean) +case class ILLoadingConfig(adtFile: String, relfFile: String, specFile: Option[String], dumpIL: Option[String]) case class BoogieGeneratorConfig(memoryFunctionType: BoogieMemoryAccessMode = BoogieMemoryAccessMode.SuccessiveStoreSelect) -case class StaticAnalysisConfig(dumpILEveryPhase: Boolean = false) +case class StaticAnalysisConfig(dumpILToPath: Option[String] = None) enum BoogieMemoryAccessMode: case SuccessiveStoreSelect, LambdaStoreSelect diff --git a/src/main/scala/util/RunUtils.scala b/src/main/scala/util/RunUtils.scala index ebe602881..ddffd96ee 100644 --- a/src/main/scala/util/RunUtils.scala +++ b/src/main/scala/util/RunUtils.scala @@ -65,7 +65,7 @@ object RunUtils { def run(q: BASILConfig): Unit = { Logger.info("[!] Writing file...") val boogieProgram = loadAndTranslate(q) - RunUtils.writeToFile(boogieProgram, q.outputPrefix + ".bpl") + RunUtils.writeToFile(boogieProgram.toString, (q.outputPrefix)) } def loadAndTranslate( @@ -93,15 +93,18 @@ object RunUtils { IRProgram = externalRemover.visitProgram(IRProgram) IRProgram = renamer.visitProgram(IRProgram) - if (q.loading.dumpIL) { - dump_file(serialiseIL(IRProgram), q.outputPrefix + "-before-analysis.il") + q.loading.dumpIL match { + case Some(s) => writeToFile(serialiseIL(IRProgram), s + "-before-analysis.il") + case _ => } q.staticAnalysis match { case Some(analysisConfig) => { IRProgram = analyse(IRProgram, externalFunctions, globals, globalOffsets) - if (analysisConfig.dumpILEveryPhase) { - dump_file(serialiseIL(IRProgram), q.outputPrefix + "-after-analysis.il") + + analysisConfig.dumpILToPath match { + case Some(s) => writeToFile(serialiseIL(IRProgram), s + "-after-analysis.il") + case _ => } } case None => {} @@ -124,7 +127,6 @@ object RunUtils { Logger.info("[!] Done! Exiting...") val boogieProgram = boogieTranslator.translate(q.boogieTranslation) boogieProgram - } def analyse( @@ -345,29 +347,10 @@ object RunUtils { (IRProgram, modified) } - def writeToFile(program: BProgram, outputFileName: String): Unit = { - try { - val writer = BufferedWriter(FileWriter(outputFileName, false)) - writer.write(program.toString) - writer.flush() - writer.close() - } catch { - case _: IOException => Logger.error("Error writing to file.") - } - } - - def dump_file(content: String, name: String): Unit = { + def writeToFile(content: String, name: String): Unit = { val outFile = new File(name) val pw = new PrintWriter(outFile, "UTF-8") pw.write(content) pw.close() } - - def dump_plot(content: String, name: String): Unit = { - val outFile = new File(s"${name}.dot") - val pw = new PrintWriter(outFile, "UTF-8") - pw.write(content) - pw.close() - } - } diff --git a/src/test/scala/MemoryRegionAnalysisMiscTest.scala b/src/test/scala/MemoryRegionAnalysisMiscTest.scala index be9695216..9aa5c1546 100644 --- a/src/test/scala/MemoryRegionAnalysisMiscTest.scala +++ b/src/test/scala/MemoryRegionAnalysisMiscTest.scala @@ -22,7 +22,7 @@ class MemoryRegionAnalysisMiscTest extends AnyFunSuite with OneInstancePerTest { adtFile = examplesPath + s"${name}/${name}.adt", relfFile = examplesPath + s"${name}/${name}.relf", specFile = None, - dumpIL = false + dumpIL = None, ), runInterpret = false, staticAnalysis = Some(StaticAnalysisConfig()), diff --git a/src/test/scala/SystemTests.scala b/src/test/scala/SystemTests.scala index 7aad8150c..00b0f40a3 100644 --- a/src/test/scala/SystemTests.scala +++ b/src/test/scala/SystemTests.scala @@ -40,13 +40,14 @@ class SystemTests extends AnyFunSuite { val variationPath = directoryPath + variation + "/" + name val specPath = directoryPath + name + ".spec" val outPath = variationPath + ".bpl" + val ilPath = variationPath val ADTPath = variationPath + ".adt" val RELFPath = variationPath + ".relf" Logger.info(outPath) if (File(specPath).exists) { - Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--spec", specPath, "--output", outPath)) + Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--spec", specPath, "--output", outPath, "--dump-il", ilPath)) } else { - Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--output", outPath)) + Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--output", outPath, "--dump-il", ilPath)) } Logger.info(outPath + " done") val boogieResult = Seq("boogie", "/timeLimit:10", "/printVerifiedProceduresCount:0", "/useArrayAxioms", outPath).!! From 4fc09f7a760c68c4b0464f5169c6db7780f69538 Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Mon, 23 Oct 2023 14:31:44 +1000 Subject: [PATCH 03/20] fix add IL updateExpected --- build.sbt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index 66d91e7d3..a384a5a01 100644 --- a/build.sbt +++ b/build.sbt @@ -52,20 +52,19 @@ updateExpected := { val result = IO.read(resultPath) val verified = result.strip().equals("Boogie program verifier finished with 0 errors") if (verified == shouldVerify) { - if (outPath.exists() && !(expectedPath.exists() || compareFiles(outPath, expectedPath))) { + if (outPath.exists() && !(expectedPath.exists() && filesContentEqual(outPath, expectedPath))) { IO.copyFile(outPath, expectedPath) } - if (ILOutPath.exists() && !(ILExpectedPath.exists() || compareFiles(ILExpectedPath, ILOutPath))) { + if (ILOutPath.exists() && !(ILExpectedPath.exists() && filesContentEqual(ILExpectedPath, ILOutPath))) { IO.copyFile(ILOutPath, ILExpectedPath) } } - } } } } } - def compareFiles(path1: File, path2: File): Boolean = { + def filesContentEqual(path1: File, path2: File): Boolean = { val source1 = Source.fromFile(path1) val source2 = Source.fromFile(path2) val lines1 = source1.getLines From 7477bbd4ed0a43a7f510212d47ff9f9720143fac Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Mon, 23 Oct 2023 14:35:21 +1000 Subject: [PATCH 04/20] update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ceb075afc..a05cb4ab0 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ samples/const_prop_tests/ src/main/antlr4/.antlr *.bpl *.dot +*.il result.txt examplesold/ src/test/scala/dump/ From 81fa6f023fd421a42340875dfd22e97490ba39fe Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Mon, 23 Oct 2023 14:35:29 +1000 Subject: [PATCH 05/20] add IL expected files --- .../arrays_simple-before-analysis.il.expected | 310 ++++++ .../arrays_simple-before-analysis.il.expected | 302 ++++++ .../arrays_simple-before-analysis.il.expected | 310 ++++++ .../arrays_simple-before-analysis.il.expected | 310 ++++++ .../arrays_simple-before-analysis.il.expected | 302 ++++++ ...ic_arrays_read-before-analysis.il.expected | 307 ++++++ ...ic_arrays_read-before-analysis.il.expected | 304 ++++++ ...ic_arrays_read-before-analysis.il.expected | 307 ++++++ ...ic_arrays_read-before-analysis.il.expected | 308 ++++++ ...ic_arrays_read-before-analysis.il.expected | 307 ++++++ ...ic_arrays_read-before-analysis.il.expected | 304 ++++++ ...ic_arrays_read-before-analysis.il.expected | 307 ++++++ ...ic_arrays_read-before-analysis.il.expected | 307 ++++++ ...c_arrays_write-before-analysis.il.expected | 309 ++++++ ...c_arrays_write-before-analysis.il.expected | 305 ++++++ ...c_arrays_write-before-analysis.il.expected | 309 ++++++ ...c_arrays_write-before-analysis.il.expected | 309 ++++++ ...c_arrays_write-before-analysis.il.expected | 309 ++++++ ...c_arrays_write-before-analysis.il.expected | 305 ++++++ ...c_arrays_write-before-analysis.il.expected | 309 ++++++ ...c_arrays_write-before-analysis.il.expected | 309 ++++++ ..._assign_assign-before-analysis.il.expected | 305 ++++++ ..._assign_assign-before-analysis.il.expected | 305 ++++++ ..._assign_assign-before-analysis.il.expected | 305 ++++++ ..._assign_assign-before-analysis.il.expected | 306 ++++++ ..._assign_assign-before-analysis.il.expected | 306 ++++++ ..._assign_assign-before-analysis.il.expected | 305 ++++++ ..._assign_assign-before-analysis.il.expected | 306 ++++++ ..._assign_assign-before-analysis.il.expected | 306 ++++++ ...sign_increment-before-analysis.il.expected | 306 ++++++ ...sign_increment-before-analysis.il.expected | 306 ++++++ ...sign_increment-before-analysis.il.expected | 306 ++++++ ...sign_increment-before-analysis.il.expected | 307 ++++++ ...sign_increment-before-analysis.il.expected | 309 ++++++ ...sign_increment-before-analysis.il.expected | 306 ++++++ ...sign_increment-before-analysis.il.expected | 309 ++++++ ...sign_increment-before-analysis.il.expected | 309 ++++++ ...on_call_caller-before-analysis.il.expected | 335 +++++++ ...on_call_caller-before-analysis.il.expected | 317 +++++++ ...on_call_caller-before-analysis.il.expected | 335 +++++++ ...on_call_caller-before-analysis.il.expected | 337 +++++++ ...on_call_caller-before-analysis.il.expected | 337 +++++++ ...on_call_caller-before-analysis.il.expected | 317 +++++++ ...on_call_caller-before-analysis.il.expected | 337 +++++++ ...on_call_caller-before-analysis.il.expected | 337 +++++++ ...on_call_reader-before-analysis.il.expected | 372 ++++++++ ...on_call_reader-before-analysis.il.expected | 334 +++++++ ...on_call_reader-before-analysis.il.expected | 372 ++++++++ ...on_call_reader-before-analysis.il.expected | 374 ++++++++ ...on_call_reader-before-analysis.il.expected | 339 +++++++ ...on_call_reader-before-analysis.il.expected | 320 +++++++ ...on_call_reader-before-analysis.il.expected | 339 +++++++ ...on_call_reader-before-analysis.il.expected | 339 +++++++ ...asic_lock_read-before-analysis.il.expected | 364 +++++++ ...asic_lock_read-before-analysis.il.expected | 322 +++++++ ...asic_lock_read-before-analysis.il.expected | 364 +++++++ ...asic_lock_read-before-analysis.il.expected | 366 +++++++ ...asic_lock_read-before-analysis.il.expected | 335 +++++++ ...asic_lock_read-before-analysis.il.expected | 321 +++++++ ...asic_lock_read-before-analysis.il.expected | 335 +++++++ ...asic_lock_read-before-analysis.il.expected | 335 +++++++ ..._security_read-before-analysis.il.expected | 363 +++++++ ..._security_read-before-analysis.il.expected | 334 +++++++ ..._security_read-before-analysis.il.expected | 363 +++++++ ..._security_read-before-analysis.il.expected | 365 +++++++ ..._security_read-before-analysis.il.expected | 332 +++++++ ..._security_read-before-analysis.il.expected | 321 +++++++ ..._security_read-before-analysis.il.expected | 332 +++++++ ..._security_read-before-analysis.il.expected | 332 +++++++ ...security_write-before-analysis.il.expected | 313 ++++++ ...security_write-before-analysis.il.expected | 306 ++++++ ...security_write-before-analysis.il.expected | 313 ++++++ ...security_write-before-analysis.il.expected | 315 ++++++ ...security_write-before-analysis.il.expected | 319 +++++++ ...security_write-before-analysis.il.expected | 306 ++++++ ...security_write-before-analysis.il.expected | 319 +++++++ ...security_write-before-analysis.il.expected | 319 +++++++ ...ic_lock_unlock-before-analysis.il.expected | 307 ++++++ ...ic_lock_unlock-before-analysis.il.expected | 307 ++++++ ...ic_lock_unlock-before-analysis.il.expected | 307 ++++++ ...ic_lock_unlock-before-analysis.il.expected | 309 ++++++ ...ic_lock_unlock-before-analysis.il.expected | 309 ++++++ ...ic_lock_unlock-before-analysis.il.expected | 307 ++++++ ...ic_lock_unlock-before-analysis.il.expected | 309 ++++++ ...ic_lock_unlock-before-analysis.il.expected | 309 ++++++ ...ic_loop_assign-before-analysis.il.expected | 305 ++++++ ...ic_loop_assign-before-analysis.il.expected | 305 ++++++ ...ic_loop_assign-before-analysis.il.expected | 305 ++++++ ...ic_loop_assign-before-analysis.il.expected | 306 ++++++ ...ic_loop_assign-before-analysis.il.expected | 306 ++++++ ...ic_loop_assign-before-analysis.il.expected | 305 ++++++ ...ic_loop_assign-before-analysis.il.expected | 306 ++++++ ...ic_loop_assign-before-analysis.il.expected | 306 ++++++ ...ion_evaluation-before-analysis.il.expected | 359 +++++++ ...ion_evaluation-before-analysis.il.expected | 302 ++++++ ...ion_evaluation-before-analysis.il.expected | 359 +++++++ ...ion_evaluation-before-analysis.il.expected | 359 +++++++ ...ion_evaluation-before-analysis.il.expected | 352 +++++++ ...ion_evaluation-before-analysis.il.expected | 302 ++++++ ...ion_evaluation-before-analysis.il.expected | 352 +++++++ ...ion_evaluation-before-analysis.il.expected | 352 +++++++ ...ec_policy_read-before-analysis.il.expected | 363 +++++++ ...ec_policy_read-before-analysis.il.expected | 334 +++++++ ...ec_policy_read-before-analysis.il.expected | 363 +++++++ ...ec_policy_read-before-analysis.il.expected | 365 +++++++ ...ec_policy_read-before-analysis.il.expected | 332 +++++++ ...ec_policy_read-before-analysis.il.expected | 321 +++++++ ...ec_policy_read-before-analysis.il.expected | 332 +++++++ ...ec_policy_read-before-analysis.il.expected | 332 +++++++ ...c_policy_write-before-analysis.il.expected | 314 ++++++ ...c_policy_write-before-analysis.il.expected | 307 ++++++ ...c_policy_write-before-analysis.il.expected | 314 ++++++ ...c_policy_write-before-analysis.il.expected | 316 +++++++ ...c_policy_write-before-analysis.il.expected | 320 +++++++ ...c_policy_write-before-analysis.il.expected | 307 ++++++ ...c_policy_write-before-analysis.il.expected | 320 +++++++ ...c_policy_write-before-analysis.il.expected | 320 +++++++ ...cassign_gamma0-before-analysis.il.expected | 306 ++++++ ...cassign_gamma0-before-analysis.il.expected | 306 ++++++ ...cassign_gamma0-before-analysis.il.expected | 306 ++++++ ...cassign_gamma0-before-analysis.il.expected | 308 ++++++ ...cassign_gamma0-before-analysis.il.expected | 308 ++++++ ...cassign_gamma0-before-analysis.il.expected | 306 ++++++ ...cassign_gamma0-before-analysis.il.expected | 308 ++++++ ...cassign_gamma0-before-analysis.il.expected | 308 ++++++ .../basicfree-before-analysis.il.expected | 336 +++++++ .../basicfree-before-analysis.il.expected | 301 ++++++ .../basicfree-before-analysis.il.expected | 336 +++++++ .../basicfree-before-analysis.il.expected | 336 +++++++ .../gcc/basicfree-before-analysis.il.expected | 335 +++++++ .../basicfree-before-analysis.il.expected | 301 ++++++ .../basicfree-before-analysis.il.expected | 335 +++++++ .../basicfree-before-analysis.il.expected | 335 +++++++ .../clang/cjump-before-analysis.il.expected | 374 ++++++++ .../cjump-before-analysis.il.expected | 308 ++++++ .../cjump-before-analysis.il.expected | 374 ++++++++ .../cjump-before-analysis.il.expected | 377 ++++++++ .../gcc/cjump-before-analysis.il.expected | 344 +++++++ .../gcc_O2/cjump-before-analysis.il.expected | 308 ++++++ .../cjump-before-analysis.il.expected | 344 +++++++ .../gcc_pic/cjump-before-analysis.il.expected | 344 +++++++ .../function-before-analysis.il.expected | 333 +++++++ .../function-before-analysis.il.expected | 318 +++++++ .../function-before-analysis.il.expected | 333 +++++++ .../function-before-analysis.il.expected | 335 +++++++ .../gcc/function-before-analysis.il.expected | 336 +++++++ .../function-before-analysis.il.expected | 318 +++++++ .../function-before-analysis.il.expected | 336 +++++++ .../function-before-analysis.il.expected | 336 +++++++ .../function1-before-analysis.il.expected | 361 +++++++ .../function1-before-analysis.il.expected | 342 +++++++ .../function1-before-analysis.il.expected | 361 +++++++ .../function1-before-analysis.il.expected | 363 +++++++ .../gcc/function1-before-analysis.il.expected | 367 +++++++ .../function1-before-analysis.il.expected | 340 +++++++ .../function1-before-analysis.il.expected | 367 +++++++ .../function1-before-analysis.il.expected | 367 +++++++ ...ns_with_params-before-analysis.il.expected | 339 +++++++ ...ns_with_params-before-analysis.il.expected | 312 ++++++ ...ns_with_params-before-analysis.il.expected | 339 +++++++ ...ns_with_params-before-analysis.il.expected | 339 +++++++ ...ns_with_params-before-analysis.il.expected | 338 +++++++ ...ns_with_params-before-analysis.il.expected | 312 ++++++ ...ns_with_params-before-analysis.il.expected | 338 +++++++ ...ns_with_params-before-analysis.il.expected | 338 +++++++ .../ifbranches-before-analysis.il.expected | 375 ++++++++ .../ifbranches-before-analysis.il.expected | 331 +++++++ .../ifbranches-before-analysis.il.expected | 375 ++++++++ .../ifbranches-before-analysis.il.expected | 375 ++++++++ .../ifbranches-before-analysis.il.expected | 342 +++++++ .../ifbranches-before-analysis.il.expected | 331 +++++++ .../ifbranches-before-analysis.il.expected | 342 +++++++ .../ifbranches-before-analysis.il.expected | 342 +++++++ .../ifglobal-before-analysis.il.expected | 362 +++++++ .../ifglobal-before-analysis.il.expected | 322 +++++++ .../ifglobal-before-analysis.il.expected | 362 +++++++ .../ifglobal-before-analysis.il.expected | 364 +++++++ .../gcc/ifglobal-before-analysis.il.expected | 329 +++++++ .../ifglobal-before-analysis.il.expected | 321 +++++++ .../ifglobal-before-analysis.il.expected | 329 +++++++ .../ifglobal-before-analysis.il.expected | 329 +++++++ .../indirect_call-before-analysis.il.expected | 343 +++++++ .../indirect_call-before-analysis.il.expected | 341 +++++++ ...initialisation-before-analysis.il.expected | 325 +++++++ ...initialisation-before-analysis.il.expected | 319 +++++++ ...initialisation-before-analysis.il.expected | 325 +++++++ ...initialisation-before-analysis.il.expected | 327 +++++++ ...initialisation-before-analysis.il.expected | 331 +++++++ ...initialisation-before-analysis.il.expected | 316 +++++++ ...initialisation-before-analysis.il.expected | 331 +++++++ ...initialisation-before-analysis.il.expected | 331 +++++++ .../jumptable-before-analysis.il.expected | 345 +++++++ .../jumptable-before-analysis.il.expected | 373 ++++++++ .../jumptable3-before-analysis.il.expected | 893 ++++++++++++++++++ .../jumptable3-before-analysis.il.expected | 636 +++++++++++++ .../jumptable3-before-analysis.il.expected | 893 ++++++++++++++++++ .../jumptable3-before-analysis.il.expected | 893 ++++++++++++++++++ ...loc_with_local-before-analysis.il.expected | 401 ++++++++ ...loc_with_local-before-analysis.il.expected | 345 +++++++ ...loc_with_local-before-analysis.il.expected | 401 ++++++++ ...loc_with_local-before-analysis.il.expected | 401 ++++++++ ...loc_with_local-before-analysis.il.expected | 399 ++++++++ ...loc_with_local-before-analysis.il.expected | 348 +++++++ ...loc_with_local-before-analysis.il.expected | 399 ++++++++ ...loc_with_local-before-analysis.il.expected | 399 ++++++++ ...oc_with_local2-before-analysis.il.expected | 417 ++++++++ ...oc_with_local2-before-analysis.il.expected | 345 +++++++ ...oc_with_local2-before-analysis.il.expected | 417 ++++++++ ...oc_with_local2-before-analysis.il.expected | 417 ++++++++ ...oc_with_local2-before-analysis.il.expected | 413 ++++++++ ...oc_with_local2-before-analysis.il.expected | 348 +++++++ ...oc_with_local2-before-analysis.il.expected | 413 ++++++++ ...oc_with_local2-before-analysis.il.expected | 413 ++++++++ ...oc_with_local3-before-analysis.il.expected | 449 +++++++++ ...oc_with_local3-before-analysis.il.expected | 361 +++++++ ...oc_with_local3-before-analysis.il.expected | 449 +++++++++ ...oc_with_local3-before-analysis.il.expected | 449 +++++++++ ...oc_with_local3-before-analysis.il.expected | 446 +++++++++ ...oc_with_local3-before-analysis.il.expected | 388 ++++++++ ...oc_with_local3-before-analysis.il.expected | 446 +++++++++ ...oc_with_local3-before-analysis.il.expected | 446 +++++++++ .../multi_malloc-before-analysis.il.expected | 388 ++++++++ .../multi_malloc-before-analysis.il.expected | 334 +++++++ .../multi_malloc-before-analysis.il.expected | 388 ++++++++ .../multi_malloc-before-analysis.il.expected | 388 ++++++++ .../multi_malloc-before-analysis.il.expected | 386 ++++++++ .../multi_malloc-before-analysis.il.expected | 336 +++++++ .../multi_malloc-before-analysis.il.expected | 386 ++++++++ .../multi_malloc-before-analysis.il.expected | 386 ++++++++ .../nestedif-before-analysis.il.expected | 487 ++++++++++ .../nestedif-before-analysis.il.expected | 302 ++++++ .../nestedif-before-analysis.il.expected | 487 ++++++++++ .../nestedif-before-analysis.il.expected | 487 ++++++++++ .../gcc/nestedif-before-analysis.il.expected | 376 ++++++++ .../nestedif-before-analysis.il.expected | 302 ++++++ .../nestedif-before-analysis.il.expected | 376 ++++++++ .../nestedif-before-analysis.il.expected | 376 ++++++++ ...rence_update_x-before-analysis.il.expected | 305 ++++++ ...rence_update_x-before-analysis.il.expected | 305 ++++++ ...rence_update_x-before-analysis.il.expected | 305 ++++++ ...rence_update_x-before-analysis.il.expected | 306 ++++++ ...rence_update_x-before-analysis.il.expected | 306 ++++++ ...rence_update_x-before-analysis.il.expected | 305 ++++++ ...rence_update_x-before-analysis.il.expected | 306 ++++++ ...rence_update_x-before-analysis.il.expected | 306 ++++++ ...rence_update_y-before-analysis.il.expected | 305 ++++++ ...rence_update_y-before-analysis.il.expected | 305 ++++++ ...rence_update_y-before-analysis.il.expected | 305 ++++++ ...rence_update_y-before-analysis.il.expected | 306 ++++++ ...rence_update_y-before-analysis.il.expected | 306 ++++++ ...rence_update_y-before-analysis.il.expected | 305 ++++++ ...rence_update_y-before-analysis.il.expected | 306 ++++++ ...rence_update_y-before-analysis.il.expected | 306 ++++++ .../secret_write-before-analysis.il.expected | 315 ++++++ .../secret_write-before-analysis.il.expected | 307 ++++++ .../secret_write-before-analysis.il.expected | 315 ++++++ .../secret_write-before-analysis.il.expected | 318 +++++++ .../secret_write-before-analysis.il.expected | 328 +++++++ .../secret_write-before-analysis.il.expected | 307 ++++++ .../secret_write-before-analysis.il.expected | 328 +++++++ .../secret_write-before-analysis.il.expected | 328 +++++++ .../simple_jump-before-analysis.il.expected | 362 +++++++ .../simple_jump-before-analysis.il.expected | 302 ++++++ .../simple_jump-before-analysis.il.expected | 362 +++++++ .../simple_jump-before-analysis.il.expected | 362 +++++++ .../simple_jump-before-analysis.il.expected | 329 +++++++ .../simple_jump-before-analysis.il.expected | 302 ++++++ .../simple_jump-before-analysis.il.expected | 329 +++++++ .../simple_jump-before-analysis.il.expected | 329 +++++++ .../clang/switch-before-analysis.il.expected | 426 +++++++++ .../switch-before-analysis.il.expected | 301 ++++++ .../switch-before-analysis.il.expected | 426 +++++++++ .../switch-before-analysis.il.expected | 426 +++++++++ .../gcc/switch-before-analysis.il.expected | 361 +++++++ .../gcc_O2/switch-before-analysis.il.expected | 301 ++++++ .../switch-before-analysis.il.expected | 361 +++++++ .../switch-before-analysis.il.expected | 361 +++++++ .../switch2-before-analysis.il.expected | 311 ++++++ .../gcc/switch2-before-analysis.il.expected | 502 ++++++++++ .../switch2-before-analysis.il.expected | 311 ++++++ .../switch2-before-analysis.il.expected | 502 ++++++++++ .../switch2-before-analysis.il.expected | 502 ++++++++++ .../clang/syscall-before-analysis.il.expected | 325 +++++++ .../syscall-before-analysis.il.expected | 325 +++++++ .../syscall-before-analysis.il.expected | 325 +++++++ .../gcc/syscall-before-analysis.il.expected | 323 +++++++ .../syscall-before-analysis.il.expected | 294 ++++++ .../syscall-before-analysis.il.expected | 323 +++++++ .../syscall-before-analysis.il.expected | 323 +++++++ ...ma_conditional-before-analysis.il.expected | 369 ++++++++ ...ma_conditional-before-analysis.il.expected | 332 +++++++ ...ma_conditional-before-analysis.il.expected | 369 ++++++++ ...ma_conditional-before-analysis.il.expected | 370 ++++++++ ...ma_conditional-before-analysis.il.expected | 333 +++++++ ...ma_conditional-before-analysis.il.expected | 332 +++++++ ...ma_conditional-before-analysis.il.expected | 333 +++++++ ...ma_conditional-before-analysis.il.expected | 333 +++++++ ..._gamma_write_z-before-analysis.il.expected | 305 ++++++ ..._gamma_write_z-before-analysis.il.expected | 305 ++++++ ..._gamma_write_z-before-analysis.il.expected | 305 ++++++ ..._gamma_write_z-before-analysis.il.expected | 306 ++++++ ..._gamma_write_z-before-analysis.il.expected | 306 ++++++ ..._gamma_write_z-before-analysis.il.expected | 305 ++++++ ..._gamma_write_z-before-analysis.il.expected | 306 ++++++ ..._gamma_write_z-before-analysis.il.expected | 306 ++++++ .../basicassign-before-analysis.il.expected | 314 ++++++ .../basicassign-before-analysis.il.expected | 308 ++++++ .../basicassign-before-analysis.il.expected | 314 ++++++ .../basicassign-before-analysis.il.expected | 317 +++++++ .../basicassign-before-analysis.il.expected | 329 +++++++ .../basicassign-before-analysis.il.expected | 308 ++++++ .../basicassign-before-analysis.il.expected | 329 +++++++ .../basicassign-before-analysis.il.expected | 329 +++++++ .../basicassign1-before-analysis.il.expected | 315 ++++++ .../basicassign1-before-analysis.il.expected | 306 ++++++ .../basicassign1-before-analysis.il.expected | 315 ++++++ .../basicassign1-before-analysis.il.expected | 317 +++++++ .../basicassign1-before-analysis.il.expected | 321 +++++++ .../basicassign1-before-analysis.il.expected | 306 ++++++ .../basicassign1-before-analysis.il.expected | 321 +++++++ .../basicassign1-before-analysis.il.expected | 321 +++++++ .../basicassign2-before-analysis.il.expected | 315 ++++++ .../basicassign2-before-analysis.il.expected | 306 ++++++ .../basicassign2-before-analysis.il.expected | 315 ++++++ .../basicassign2-before-analysis.il.expected | 317 +++++++ .../basicassign2-before-analysis.il.expected | 321 +++++++ .../basicassign2-before-analysis.il.expected | 306 ++++++ .../basicassign2-before-analysis.il.expected | 321 +++++++ .../basicassign2-before-analysis.il.expected | 321 +++++++ .../basicassign3-before-analysis.il.expected | 315 ++++++ .../basicassign3-before-analysis.il.expected | 306 ++++++ .../basicassign3-before-analysis.il.expected | 315 ++++++ .../basicassign3-before-analysis.il.expected | 317 +++++++ .../basicassign3-before-analysis.il.expected | 321 +++++++ .../basicassign3-before-analysis.il.expected | 306 ++++++ .../basicassign3-before-analysis.il.expected | 321 +++++++ .../basicassign3-before-analysis.il.expected | 321 +++++++ .../clang/iflocal-before-analysis.il.expected | 363 +++++++ .../iflocal-before-analysis.il.expected | 363 +++++++ .../iflocal-before-analysis.il.expected | 363 +++++++ .../gcc/iflocal-before-analysis.il.expected | 330 +++++++ .../iflocal-before-analysis.il.expected | 330 +++++++ .../iflocal-before-analysis.il.expected | 330 +++++++ ...nestedifglobal-before-analysis.il.expected | 477 ++++++++++ ...nestedifglobal-before-analysis.il.expected | 477 ++++++++++ ...nestedifglobal-before-analysis.il.expected | 480 ++++++++++ ...nestedifglobal-before-analysis.il.expected | 385 ++++++++ ...nestedifglobal-before-analysis.il.expected | 385 ++++++++ ...nestedifglobal-before-analysis.il.expected | 385 ++++++++ 349 files changed, 119888 insertions(+) create mode 100644 src/test/correct/arrays_simple/clang/arrays_simple-before-analysis.il.expected create mode 100644 src/test/correct/arrays_simple/clang_O2/arrays_simple-before-analysis.il.expected create mode 100644 src/test/correct/arrays_simple/clang_no_plt_no_pic/arrays_simple-before-analysis.il.expected create mode 100644 src/test/correct/arrays_simple/clang_pic/arrays_simple-before-analysis.il.expected create mode 100644 src/test/correct/arrays_simple/gcc_O2/arrays_simple-before-analysis.il.expected create mode 100644 src/test/correct/basic_arrays_read/clang/basic_arrays_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_arrays_read/clang_O2/basic_arrays_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_arrays_read/clang_no_plt_no_pic/basic_arrays_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_arrays_read/clang_pic/basic_arrays_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_arrays_read/gcc/basic_arrays_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_arrays_read/gcc_O2/basic_arrays_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_arrays_read/gcc_no_plt_no_pic/basic_arrays_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_arrays_read/gcc_pic/basic_arrays_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_arrays_write/clang/basic_arrays_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_arrays_write/clang_O2/basic_arrays_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_arrays_write/clang_no_plt_no_pic/basic_arrays_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_arrays_write/clang_pic/basic_arrays_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_arrays_write/gcc/basic_arrays_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_arrays_write/gcc_O2/basic_arrays_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_arrays_write/gcc_no_plt_no_pic/basic_arrays_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_arrays_write/gcc_pic/basic_arrays_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_assign_assign/clang/basic_assign_assign-before-analysis.il.expected create mode 100644 src/test/correct/basic_assign_assign/clang_O2/basic_assign_assign-before-analysis.il.expected create mode 100644 src/test/correct/basic_assign_assign/clang_no_plt_no_pic/basic_assign_assign-before-analysis.il.expected create mode 100644 src/test/correct/basic_assign_assign/clang_pic/basic_assign_assign-before-analysis.il.expected create mode 100644 src/test/correct/basic_assign_assign/gcc/basic_assign_assign-before-analysis.il.expected create mode 100644 src/test/correct/basic_assign_assign/gcc_O2/basic_assign_assign-before-analysis.il.expected create mode 100644 src/test/correct/basic_assign_assign/gcc_no_plt_no_pic/basic_assign_assign-before-analysis.il.expected create mode 100644 src/test/correct/basic_assign_assign/gcc_pic/basic_assign_assign-before-analysis.il.expected create mode 100644 src/test/correct/basic_assign_increment/clang/basic_assign_increment-before-analysis.il.expected create mode 100644 src/test/correct/basic_assign_increment/clang_O2/basic_assign_increment-before-analysis.il.expected create mode 100644 src/test/correct/basic_assign_increment/clang_no_plt_no_pic/basic_assign_increment-before-analysis.il.expected create mode 100644 src/test/correct/basic_assign_increment/clang_pic/basic_assign_increment-before-analysis.il.expected create mode 100644 src/test/correct/basic_assign_increment/gcc/basic_assign_increment-before-analysis.il.expected create mode 100644 src/test/correct/basic_assign_increment/gcc_O2/basic_assign_increment-before-analysis.il.expected create mode 100644 src/test/correct/basic_assign_increment/gcc_no_plt_no_pic/basic_assign_increment-before-analysis.il.expected create mode 100644 src/test/correct/basic_assign_increment/gcc_pic/basic_assign_increment-before-analysis.il.expected create mode 100644 src/test/correct/basic_function_call_caller/clang/basic_function_call_caller-before-analysis.il.expected create mode 100644 src/test/correct/basic_function_call_caller/clang_O2/basic_function_call_caller-before-analysis.il.expected create mode 100644 src/test/correct/basic_function_call_caller/clang_no_plt_no_pic/basic_function_call_caller-before-analysis.il.expected create mode 100644 src/test/correct/basic_function_call_caller/clang_pic/basic_function_call_caller-before-analysis.il.expected create mode 100644 src/test/correct/basic_function_call_caller/gcc/basic_function_call_caller-before-analysis.il.expected create mode 100644 src/test/correct/basic_function_call_caller/gcc_O2/basic_function_call_caller-before-analysis.il.expected create mode 100644 src/test/correct/basic_function_call_caller/gcc_no_plt_no_pic/basic_function_call_caller-before-analysis.il.expected create mode 100644 src/test/correct/basic_function_call_caller/gcc_pic/basic_function_call_caller-before-analysis.il.expected create mode 100644 src/test/correct/basic_function_call_reader/clang/basic_function_call_reader-before-analysis.il.expected create mode 100644 src/test/correct/basic_function_call_reader/clang_O2/basic_function_call_reader-before-analysis.il.expected create mode 100644 src/test/correct/basic_function_call_reader/clang_no_plt_no_pic/basic_function_call_reader-before-analysis.il.expected create mode 100644 src/test/correct/basic_function_call_reader/clang_pic/basic_function_call_reader-before-analysis.il.expected create mode 100644 src/test/correct/basic_function_call_reader/gcc/basic_function_call_reader-before-analysis.il.expected create mode 100644 src/test/correct/basic_function_call_reader/gcc_O2/basic_function_call_reader-before-analysis.il.expected create mode 100644 src/test/correct/basic_function_call_reader/gcc_no_plt_no_pic/basic_function_call_reader-before-analysis.il.expected create mode 100644 src/test/correct/basic_function_call_reader/gcc_pic/basic_function_call_reader-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_read/clang/basic_lock_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_read/clang_O2/basic_lock_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_read/clang_no_plt_no_pic/basic_lock_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_read/clang_pic/basic_lock_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_read/gcc/basic_lock_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_read/gcc_O2/basic_lock_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_read/gcc_no_plt_no_pic/basic_lock_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_read/gcc_pic/basic_lock_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_security_read/clang/basic_lock_security_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_security_read/clang_O2/basic_lock_security_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_security_read/clang_no_plt_no_pic/basic_lock_security_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_security_read/clang_pic/basic_lock_security_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_security_read/gcc/basic_lock_security_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_security_read/gcc_O2/basic_lock_security_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_security_read/gcc_no_plt_no_pic/basic_lock_security_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_security_read/gcc_pic/basic_lock_security_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_security_write/clang/basic_lock_security_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_security_write/clang_O2/basic_lock_security_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_security_write/clang_no_plt_no_pic/basic_lock_security_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_security_write/clang_pic/basic_lock_security_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_security_write/gcc/basic_lock_security_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_security_write/gcc_O2/basic_lock_security_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_security_write/gcc_no_plt_no_pic/basic_lock_security_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_security_write/gcc_pic/basic_lock_security_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_unlock/clang/basic_lock_unlock-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_unlock/clang_O2/basic_lock_unlock-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_unlock/clang_no_plt_no_pic/basic_lock_unlock-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_unlock/clang_pic/basic_lock_unlock-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_unlock/gcc/basic_lock_unlock-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_unlock/gcc_O2/basic_lock_unlock-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_unlock/gcc_no_plt_no_pic/basic_lock_unlock-before-analysis.il.expected create mode 100644 src/test/correct/basic_lock_unlock/gcc_pic/basic_lock_unlock-before-analysis.il.expected create mode 100644 src/test/correct/basic_loop_assign/clang/basic_loop_assign-before-analysis.il.expected create mode 100644 src/test/correct/basic_loop_assign/clang_O2/basic_loop_assign-before-analysis.il.expected create mode 100644 src/test/correct/basic_loop_assign/clang_no_plt_no_pic/basic_loop_assign-before-analysis.il.expected create mode 100644 src/test/correct/basic_loop_assign/clang_pic/basic_loop_assign-before-analysis.il.expected create mode 100644 src/test/correct/basic_loop_assign/gcc/basic_loop_assign-before-analysis.il.expected create mode 100644 src/test/correct/basic_loop_assign/gcc_O2/basic_loop_assign-before-analysis.il.expected create mode 100644 src/test/correct/basic_loop_assign/gcc_no_plt_no_pic/basic_loop_assign-before-analysis.il.expected create mode 100644 src/test/correct/basic_loop_assign/gcc_pic/basic_loop_assign-before-analysis.il.expected create mode 100644 src/test/correct/basic_operation_evaluation/clang/basic_operation_evaluation-before-analysis.il.expected create mode 100644 src/test/correct/basic_operation_evaluation/clang_O2/basic_operation_evaluation-before-analysis.il.expected create mode 100644 src/test/correct/basic_operation_evaluation/clang_no_plt_no_pic/basic_operation_evaluation-before-analysis.il.expected create mode 100644 src/test/correct/basic_operation_evaluation/clang_pic/basic_operation_evaluation-before-analysis.il.expected create mode 100644 src/test/correct/basic_operation_evaluation/gcc/basic_operation_evaluation-before-analysis.il.expected create mode 100644 src/test/correct/basic_operation_evaluation/gcc_O2/basic_operation_evaluation-before-analysis.il.expected create mode 100644 src/test/correct/basic_operation_evaluation/gcc_no_plt_no_pic/basic_operation_evaluation-before-analysis.il.expected create mode 100644 src/test/correct/basic_operation_evaluation/gcc_pic/basic_operation_evaluation-before-analysis.il.expected create mode 100644 src/test/correct/basic_sec_policy_read/clang/basic_sec_policy_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_sec_policy_read/clang_O2/basic_sec_policy_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_sec_policy_read/clang_no_plt_no_pic/basic_sec_policy_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_sec_policy_read/clang_pic/basic_sec_policy_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_sec_policy_read/gcc/basic_sec_policy_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_sec_policy_read/gcc_O2/basic_sec_policy_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_sec_policy_read/gcc_no_plt_no_pic/basic_sec_policy_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_sec_policy_read/gcc_pic/basic_sec_policy_read-before-analysis.il.expected create mode 100644 src/test/correct/basic_sec_policy_write/clang/basic_sec_policy_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_sec_policy_write/clang_O2/basic_sec_policy_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_sec_policy_write/clang_no_plt_no_pic/basic_sec_policy_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_sec_policy_write/clang_pic/basic_sec_policy_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_sec_policy_write/gcc/basic_sec_policy_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_sec_policy_write/gcc_O2/basic_sec_policy_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_sec_policy_write/gcc_no_plt_no_pic/basic_sec_policy_write-before-analysis.il.expected create mode 100644 src/test/correct/basic_sec_policy_write/gcc_pic/basic_sec_policy_write-before-analysis.il.expected create mode 100644 src/test/correct/basicassign_gamma0/clang/basicassign_gamma0-before-analysis.il.expected create mode 100644 src/test/correct/basicassign_gamma0/clang_O2/basicassign_gamma0-before-analysis.il.expected create mode 100644 src/test/correct/basicassign_gamma0/clang_no_plt_no_pic/basicassign_gamma0-before-analysis.il.expected create mode 100644 src/test/correct/basicassign_gamma0/clang_pic/basicassign_gamma0-before-analysis.il.expected create mode 100644 src/test/correct/basicassign_gamma0/gcc/basicassign_gamma0-before-analysis.il.expected create mode 100644 src/test/correct/basicassign_gamma0/gcc_O2/basicassign_gamma0-before-analysis.il.expected create mode 100644 src/test/correct/basicassign_gamma0/gcc_no_plt_no_pic/basicassign_gamma0-before-analysis.il.expected create mode 100644 src/test/correct/basicassign_gamma0/gcc_pic/basicassign_gamma0-before-analysis.il.expected create mode 100644 src/test/correct/basicfree/clang/basicfree-before-analysis.il.expected create mode 100644 src/test/correct/basicfree/clang_O2/basicfree-before-analysis.il.expected create mode 100644 src/test/correct/basicfree/clang_no_plt_no_pic/basicfree-before-analysis.il.expected create mode 100644 src/test/correct/basicfree/clang_pic/basicfree-before-analysis.il.expected create mode 100644 src/test/correct/basicfree/gcc/basicfree-before-analysis.il.expected create mode 100644 src/test/correct/basicfree/gcc_O2/basicfree-before-analysis.il.expected create mode 100644 src/test/correct/basicfree/gcc_no_plt_no_pic/basicfree-before-analysis.il.expected create mode 100644 src/test/correct/basicfree/gcc_pic/basicfree-before-analysis.il.expected create mode 100644 src/test/correct/cjump/clang/cjump-before-analysis.il.expected create mode 100644 src/test/correct/cjump/clang_O2/cjump-before-analysis.il.expected create mode 100644 src/test/correct/cjump/clang_no_plt_no_pic/cjump-before-analysis.il.expected create mode 100644 src/test/correct/cjump/clang_pic/cjump-before-analysis.il.expected create mode 100644 src/test/correct/cjump/gcc/cjump-before-analysis.il.expected create mode 100644 src/test/correct/cjump/gcc_O2/cjump-before-analysis.il.expected create mode 100644 src/test/correct/cjump/gcc_no_plt_no_pic/cjump-before-analysis.il.expected create mode 100644 src/test/correct/cjump/gcc_pic/cjump-before-analysis.il.expected create mode 100644 src/test/correct/function/clang/function-before-analysis.il.expected create mode 100644 src/test/correct/function/clang_O2/function-before-analysis.il.expected create mode 100644 src/test/correct/function/clang_no_plt_no_pic/function-before-analysis.il.expected create mode 100644 src/test/correct/function/clang_pic/function-before-analysis.il.expected create mode 100644 src/test/correct/function/gcc/function-before-analysis.il.expected create mode 100644 src/test/correct/function/gcc_O2/function-before-analysis.il.expected create mode 100644 src/test/correct/function/gcc_no_plt_no_pic/function-before-analysis.il.expected create mode 100644 src/test/correct/function/gcc_pic/function-before-analysis.il.expected create mode 100644 src/test/correct/function1/clang/function1-before-analysis.il.expected create mode 100644 src/test/correct/function1/clang_O2/function1-before-analysis.il.expected create mode 100644 src/test/correct/function1/clang_no_plt_no_pic/function1-before-analysis.il.expected create mode 100644 src/test/correct/function1/clang_pic/function1-before-analysis.il.expected create mode 100644 src/test/correct/function1/gcc/function1-before-analysis.il.expected create mode 100644 src/test/correct/function1/gcc_O2/function1-before-analysis.il.expected create mode 100644 src/test/correct/function1/gcc_no_plt_no_pic/function1-before-analysis.il.expected create mode 100644 src/test/correct/function1/gcc_pic/function1-before-analysis.il.expected create mode 100644 src/test/correct/functions_with_params/clang/functions_with_params-before-analysis.il.expected create mode 100644 src/test/correct/functions_with_params/clang_O2/functions_with_params-before-analysis.il.expected create mode 100644 src/test/correct/functions_with_params/clang_no_plt_no_pic/functions_with_params-before-analysis.il.expected create mode 100644 src/test/correct/functions_with_params/clang_pic/functions_with_params-before-analysis.il.expected create mode 100644 src/test/correct/functions_with_params/gcc/functions_with_params-before-analysis.il.expected create mode 100644 src/test/correct/functions_with_params/gcc_O2/functions_with_params-before-analysis.il.expected create mode 100644 src/test/correct/functions_with_params/gcc_no_plt_no_pic/functions_with_params-before-analysis.il.expected create mode 100644 src/test/correct/functions_with_params/gcc_pic/functions_with_params-before-analysis.il.expected create mode 100644 src/test/correct/ifbranches/clang/ifbranches-before-analysis.il.expected create mode 100644 src/test/correct/ifbranches/clang_O2/ifbranches-before-analysis.il.expected create mode 100644 src/test/correct/ifbranches/clang_no_plt_no_pic/ifbranches-before-analysis.il.expected create mode 100644 src/test/correct/ifbranches/clang_pic/ifbranches-before-analysis.il.expected create mode 100644 src/test/correct/ifbranches/gcc/ifbranches-before-analysis.il.expected create mode 100644 src/test/correct/ifbranches/gcc_O2/ifbranches-before-analysis.il.expected create mode 100644 src/test/correct/ifbranches/gcc_no_plt_no_pic/ifbranches-before-analysis.il.expected create mode 100644 src/test/correct/ifbranches/gcc_pic/ifbranches-before-analysis.il.expected create mode 100644 src/test/correct/ifglobal/clang/ifglobal-before-analysis.il.expected create mode 100644 src/test/correct/ifglobal/clang_O2/ifglobal-before-analysis.il.expected create mode 100644 src/test/correct/ifglobal/clang_no_plt_no_pic/ifglobal-before-analysis.il.expected create mode 100644 src/test/correct/ifglobal/clang_pic/ifglobal-before-analysis.il.expected create mode 100644 src/test/correct/ifglobal/gcc/ifglobal-before-analysis.il.expected create mode 100644 src/test/correct/ifglobal/gcc_O2/ifglobal-before-analysis.il.expected create mode 100644 src/test/correct/ifglobal/gcc_no_plt_no_pic/ifglobal-before-analysis.il.expected create mode 100644 src/test/correct/ifglobal/gcc_pic/ifglobal-before-analysis.il.expected create mode 100644 src/test/correct/indirect_call/clang_O2/indirect_call-before-analysis.il.expected create mode 100644 src/test/correct/indirect_call/gcc_O2/indirect_call-before-analysis.il.expected create mode 100644 src/test/correct/initialisation/clang/initialisation-before-analysis.il.expected create mode 100644 src/test/correct/initialisation/clang_O2/initialisation-before-analysis.il.expected create mode 100644 src/test/correct/initialisation/clang_no_plt_no_pic/initialisation-before-analysis.il.expected create mode 100644 src/test/correct/initialisation/clang_pic/initialisation-before-analysis.il.expected create mode 100644 src/test/correct/initialisation/gcc/initialisation-before-analysis.il.expected create mode 100644 src/test/correct/initialisation/gcc_O2/initialisation-before-analysis.il.expected create mode 100644 src/test/correct/initialisation/gcc_no_plt_no_pic/initialisation-before-analysis.il.expected create mode 100644 src/test/correct/initialisation/gcc_pic/initialisation-before-analysis.il.expected create mode 100644 src/test/correct/jumptable/clang_O2/jumptable-before-analysis.il.expected create mode 100644 src/test/correct/jumptable/gcc_O2/jumptable-before-analysis.il.expected create mode 100644 src/test/correct/jumptable3/gcc/jumptable3-before-analysis.il.expected create mode 100644 src/test/correct/jumptable3/gcc_O2/jumptable3-before-analysis.il.expected create mode 100644 src/test/correct/jumptable3/gcc_no_plt_no_pic/jumptable3-before-analysis.il.expected create mode 100644 src/test/correct/jumptable3/gcc_pic/jumptable3-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local/clang/malloc_with_local-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local/clang_O2/malloc_with_local-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local/clang_no_plt_no_pic/malloc_with_local-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local/clang_pic/malloc_with_local-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local/gcc/malloc_with_local-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local/gcc_O2/malloc_with_local-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local/gcc_no_plt_no_pic/malloc_with_local-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local/gcc_pic/malloc_with_local-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local2/clang/malloc_with_local2-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local2/clang_O2/malloc_with_local2-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local2/clang_no_plt_no_pic/malloc_with_local2-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local2/clang_pic/malloc_with_local2-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local2/gcc/malloc_with_local2-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local2/gcc_O2/malloc_with_local2-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local2/gcc_no_plt_no_pic/malloc_with_local2-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local2/gcc_pic/malloc_with_local2-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local3/clang/malloc_with_local3-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local3/clang_O2/malloc_with_local3-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local3/clang_no_plt_no_pic/malloc_with_local3-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local3/clang_pic/malloc_with_local3-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local3/gcc/malloc_with_local3-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local3/gcc_O2/malloc_with_local3-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local3/gcc_no_plt_no_pic/malloc_with_local3-before-analysis.il.expected create mode 100644 src/test/correct/malloc_with_local3/gcc_pic/malloc_with_local3-before-analysis.il.expected create mode 100644 src/test/correct/multi_malloc/clang/multi_malloc-before-analysis.il.expected create mode 100644 src/test/correct/multi_malloc/clang_O2/multi_malloc-before-analysis.il.expected create mode 100644 src/test/correct/multi_malloc/clang_no_plt_no_pic/multi_malloc-before-analysis.il.expected create mode 100644 src/test/correct/multi_malloc/clang_pic/multi_malloc-before-analysis.il.expected create mode 100644 src/test/correct/multi_malloc/gcc/multi_malloc-before-analysis.il.expected create mode 100644 src/test/correct/multi_malloc/gcc_O2/multi_malloc-before-analysis.il.expected create mode 100644 src/test/correct/multi_malloc/gcc_no_plt_no_pic/multi_malloc-before-analysis.il.expected create mode 100644 src/test/correct/multi_malloc/gcc_pic/multi_malloc-before-analysis.il.expected create mode 100644 src/test/correct/nestedif/clang/nestedif-before-analysis.il.expected create mode 100644 src/test/correct/nestedif/clang_O2/nestedif-before-analysis.il.expected create mode 100644 src/test/correct/nestedif/clang_no_plt_no_pic/nestedif-before-analysis.il.expected create mode 100644 src/test/correct/nestedif/clang_pic/nestedif-before-analysis.il.expected create mode 100644 src/test/correct/nestedif/gcc/nestedif-before-analysis.il.expected create mode 100644 src/test/correct/nestedif/gcc_O2/nestedif-before-analysis.il.expected create mode 100644 src/test/correct/nestedif/gcc_no_plt_no_pic/nestedif-before-analysis.il.expected create mode 100644 src/test/correct/nestedif/gcc_pic/nestedif-before-analysis.il.expected create mode 100644 src/test/correct/no_interference_update_x/clang/no_interference_update_x-before-analysis.il.expected create mode 100644 src/test/correct/no_interference_update_x/clang_O2/no_interference_update_x-before-analysis.il.expected create mode 100644 src/test/correct/no_interference_update_x/clang_no_plt_no_pic/no_interference_update_x-before-analysis.il.expected create mode 100644 src/test/correct/no_interference_update_x/clang_pic/no_interference_update_x-before-analysis.il.expected create mode 100644 src/test/correct/no_interference_update_x/gcc/no_interference_update_x-before-analysis.il.expected create mode 100644 src/test/correct/no_interference_update_x/gcc_O2/no_interference_update_x-before-analysis.il.expected create mode 100644 src/test/correct/no_interference_update_x/gcc_no_plt_no_pic/no_interference_update_x-before-analysis.il.expected create mode 100644 src/test/correct/no_interference_update_x/gcc_pic/no_interference_update_x-before-analysis.il.expected create mode 100644 src/test/correct/no_interference_update_y/clang/no_interference_update_y-before-analysis.il.expected create mode 100644 src/test/correct/no_interference_update_y/clang_O2/no_interference_update_y-before-analysis.il.expected create mode 100644 src/test/correct/no_interference_update_y/clang_no_plt_no_pic/no_interference_update_y-before-analysis.il.expected create mode 100644 src/test/correct/no_interference_update_y/clang_pic/no_interference_update_y-before-analysis.il.expected create mode 100644 src/test/correct/no_interference_update_y/gcc/no_interference_update_y-before-analysis.il.expected create mode 100644 src/test/correct/no_interference_update_y/gcc_O2/no_interference_update_y-before-analysis.il.expected create mode 100644 src/test/correct/no_interference_update_y/gcc_no_plt_no_pic/no_interference_update_y-before-analysis.il.expected create mode 100644 src/test/correct/no_interference_update_y/gcc_pic/no_interference_update_y-before-analysis.il.expected create mode 100644 src/test/correct/secret_write/clang/secret_write-before-analysis.il.expected create mode 100644 src/test/correct/secret_write/clang_O2/secret_write-before-analysis.il.expected create mode 100644 src/test/correct/secret_write/clang_no_plt_no_pic/secret_write-before-analysis.il.expected create mode 100644 src/test/correct/secret_write/clang_pic/secret_write-before-analysis.il.expected create mode 100644 src/test/correct/secret_write/gcc/secret_write-before-analysis.il.expected create mode 100644 src/test/correct/secret_write/gcc_O2/secret_write-before-analysis.il.expected create mode 100644 src/test/correct/secret_write/gcc_no_plt_no_pic/secret_write-before-analysis.il.expected create mode 100644 src/test/correct/secret_write/gcc_pic/secret_write-before-analysis.il.expected create mode 100644 src/test/correct/simple_jump/clang/simple_jump-before-analysis.il.expected create mode 100644 src/test/correct/simple_jump/clang_O2/simple_jump-before-analysis.il.expected create mode 100644 src/test/correct/simple_jump/clang_no_plt_no_pic/simple_jump-before-analysis.il.expected create mode 100644 src/test/correct/simple_jump/clang_pic/simple_jump-before-analysis.il.expected create mode 100644 src/test/correct/simple_jump/gcc/simple_jump-before-analysis.il.expected create mode 100644 src/test/correct/simple_jump/gcc_O2/simple_jump-before-analysis.il.expected create mode 100644 src/test/correct/simple_jump/gcc_no_plt_no_pic/simple_jump-before-analysis.il.expected create mode 100644 src/test/correct/simple_jump/gcc_pic/simple_jump-before-analysis.il.expected create mode 100644 src/test/correct/switch/clang/switch-before-analysis.il.expected create mode 100644 src/test/correct/switch/clang_O2/switch-before-analysis.il.expected create mode 100644 src/test/correct/switch/clang_no_plt_no_pic/switch-before-analysis.il.expected create mode 100644 src/test/correct/switch/clang_pic/switch-before-analysis.il.expected create mode 100644 src/test/correct/switch/gcc/switch-before-analysis.il.expected create mode 100644 src/test/correct/switch/gcc_O2/switch-before-analysis.il.expected create mode 100644 src/test/correct/switch/gcc_no_plt_no_pic/switch-before-analysis.il.expected create mode 100644 src/test/correct/switch/gcc_pic/switch-before-analysis.il.expected create mode 100644 src/test/correct/switch2/clang_O2/switch2-before-analysis.il.expected create mode 100644 src/test/correct/switch2/gcc/switch2-before-analysis.il.expected create mode 100644 src/test/correct/switch2/gcc_O2/switch2-before-analysis.il.expected create mode 100644 src/test/correct/switch2/gcc_no_plt_no_pic/switch2-before-analysis.il.expected create mode 100644 src/test/correct/switch2/gcc_pic/switch2-before-analysis.il.expected create mode 100644 src/test/correct/syscall/clang/syscall-before-analysis.il.expected create mode 100644 src/test/correct/syscall/clang_no_plt_no_pic/syscall-before-analysis.il.expected create mode 100644 src/test/correct/syscall/clang_pic/syscall-before-analysis.il.expected create mode 100644 src/test/correct/syscall/gcc/syscall-before-analysis.il.expected create mode 100644 src/test/correct/syscall/gcc_O2/syscall-before-analysis.il.expected create mode 100644 src/test/correct/syscall/gcc_no_plt_no_pic/syscall-before-analysis.il.expected create mode 100644 src/test/correct/syscall/gcc_pic/syscall-before-analysis.il.expected create mode 100644 src/test/correct/using_gamma_conditional/clang/using_gamma_conditional-before-analysis.il.expected create mode 100644 src/test/correct/using_gamma_conditional/clang_O2/using_gamma_conditional-before-analysis.il.expected create mode 100644 src/test/correct/using_gamma_conditional/clang_no_plt_no_pic/using_gamma_conditional-before-analysis.il.expected create mode 100644 src/test/correct/using_gamma_conditional/clang_pic/using_gamma_conditional-before-analysis.il.expected create mode 100644 src/test/correct/using_gamma_conditional/gcc/using_gamma_conditional-before-analysis.il.expected create mode 100644 src/test/correct/using_gamma_conditional/gcc_O2/using_gamma_conditional-before-analysis.il.expected create mode 100644 src/test/correct/using_gamma_conditional/gcc_no_plt_no_pic/using_gamma_conditional-before-analysis.il.expected create mode 100644 src/test/correct/using_gamma_conditional/gcc_pic/using_gamma_conditional-before-analysis.il.expected create mode 100644 src/test/correct/using_gamma_write_z/clang/using_gamma_write_z-before-analysis.il.expected create mode 100644 src/test/correct/using_gamma_write_z/clang_O2/using_gamma_write_z-before-analysis.il.expected create mode 100644 src/test/correct/using_gamma_write_z/clang_no_plt_no_pic/using_gamma_write_z-before-analysis.il.expected create mode 100644 src/test/correct/using_gamma_write_z/clang_pic/using_gamma_write_z-before-analysis.il.expected create mode 100644 src/test/correct/using_gamma_write_z/gcc/using_gamma_write_z-before-analysis.il.expected create mode 100644 src/test/correct/using_gamma_write_z/gcc_O2/using_gamma_write_z-before-analysis.il.expected create mode 100644 src/test/correct/using_gamma_write_z/gcc_no_plt_no_pic/using_gamma_write_z-before-analysis.il.expected create mode 100644 src/test/correct/using_gamma_write_z/gcc_pic/using_gamma_write_z-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign/clang/basicassign-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign/clang_O2/basicassign-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign/clang_no_plt_no_pic/basicassign-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign/clang_pic/basicassign-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign/gcc/basicassign-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign/gcc_O2/basicassign-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign/gcc_no_plt_no_pic/basicassign-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign/gcc_pic/basicassign-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign1/clang/basicassign1-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign1/clang_O2/basicassign1-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign1/clang_no_plt_no_pic/basicassign1-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign1/clang_pic/basicassign1-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign1/gcc/basicassign1-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign1/gcc_O2/basicassign1-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign1/gcc_no_plt_no_pic/basicassign1-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign1/gcc_pic/basicassign1-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign2/clang/basicassign2-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign2/clang_O2/basicassign2-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign2/clang_no_plt_no_pic/basicassign2-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign2/clang_pic/basicassign2-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign2/gcc/basicassign2-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign2/gcc_O2/basicassign2-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign2/gcc_no_plt_no_pic/basicassign2-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign2/gcc_pic/basicassign2-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign3/clang/basicassign3-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign3/clang_O2/basicassign3-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign3/clang_no_plt_no_pic/basicassign3-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign3/clang_pic/basicassign3-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign3/gcc/basicassign3-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign3/gcc_O2/basicassign3-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign3/gcc_no_plt_no_pic/basicassign3-before-analysis.il.expected create mode 100644 src/test/incorrect/basicassign3/gcc_pic/basicassign3-before-analysis.il.expected create mode 100644 src/test/incorrect/iflocal/clang/iflocal-before-analysis.il.expected create mode 100644 src/test/incorrect/iflocal/clang_no_plt_no_pic/iflocal-before-analysis.il.expected create mode 100644 src/test/incorrect/iflocal/clang_pic/iflocal-before-analysis.il.expected create mode 100644 src/test/incorrect/iflocal/gcc/iflocal-before-analysis.il.expected create mode 100644 src/test/incorrect/iflocal/gcc_no_plt_no_pic/iflocal-before-analysis.il.expected create mode 100644 src/test/incorrect/iflocal/gcc_pic/iflocal-before-analysis.il.expected create mode 100644 src/test/incorrect/nestedifglobal/clang/nestedifglobal-before-analysis.il.expected create mode 100644 src/test/incorrect/nestedifglobal/clang_no_plt_no_pic/nestedifglobal-before-analysis.il.expected create mode 100644 src/test/incorrect/nestedifglobal/clang_pic/nestedifglobal-before-analysis.il.expected create mode 100644 src/test/incorrect/nestedifglobal/gcc/nestedifglobal-before-analysis.il.expected create mode 100644 src/test/incorrect/nestedifglobal/gcc_no_plt_no_pic/nestedifglobal-before-analysis.il.expected create mode 100644 src/test/incorrect/nestedifglobal/gcc_pic/nestedifglobal-before-analysis.il.expected diff --git a/src/test/correct/arrays_simple/clang/arrays_simple-before-analysis.il.expected b/src/test/correct/arrays_simple/clang/arrays_simple-before-analysis.il.expected new file mode 100644 index 000000000..5758766d6 --- /dev/null +++ b/src/test/correct/arrays_simple/clang/arrays_simple-before-analysis.il.expected @@ -0,0 +1,310 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000861", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000008c9", condition()) + ) + ) + Block("1752:l000008c9", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000008d7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000008f0", condition()) + ) + ) + Block("1764:l000008f0", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000008d7", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000008e3", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000861", condition()) + ) + ) + Block("1788:l00000861", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1852:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1852:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000acd", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000078b", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000b59", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000940", condition()) + ) + ) + Block("1604:l000007a1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000940", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000007e6", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000922", condition()) + ) + ) + Block("1640:l00000922", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l000007e6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000935", condition()) + ) + ) + Block("1660:l000007e6", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000935", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + LocalAssign(Register(R8, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 7bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000822", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000904", condition()) + ) + ) + Block("1700:l00000904", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000822", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000917", condition()) + ) + ) + Block("1720:l00000822", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000917", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/arrays_simple/clang_O2/arrays_simple-before-analysis.il.expected b/src/test/correct/arrays_simple/clang_O2/arrays_simple-before-analysis.il.expected new file mode 100644 index 000000000..5a5a5bf1d --- /dev/null +++ b/src/test/correct/arrays_simple/clang_O2/arrays_simple-before-analysis.il.expected @@ -0,0 +1,302 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000289", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002bc", condition()) + ) + ) + Block("1752:l000002bc", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000002e3", condition()) + ) + ) + Block("1764:l000002e3", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002ca", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002d6", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000289", condition()) + ) + ) + Block("1788:l00000289", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1820:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1820:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004b8", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001b3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000055e", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001c9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000333", condition()) + ) + ) + Block("1604:l000001c9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000333", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000020e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000315", condition()) + ) + ) + Block("1640:l00000315", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000020e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000328", condition()) + ) + ) + Block("1660:l0000020e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000328", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000002f7", condition()) + ) + ) + Block("1700:l000002f7", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000030a", condition()) + ) + ) + Block("1720:l0000024a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000030a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/arrays_simple/clang_no_plt_no_pic/arrays_simple-before-analysis.il.expected b/src/test/correct/arrays_simple/clang_no_plt_no_pic/arrays_simple-before-analysis.il.expected new file mode 100644 index 000000000..5758766d6 --- /dev/null +++ b/src/test/correct/arrays_simple/clang_no_plt_no_pic/arrays_simple-before-analysis.il.expected @@ -0,0 +1,310 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000861", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000008c9", condition()) + ) + ) + Block("1752:l000008c9", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000008d7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000008f0", condition()) + ) + ) + Block("1764:l000008f0", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000008d7", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000008e3", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000861", condition()) + ) + ) + Block("1788:l00000861", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1852:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1852:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000acd", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000078b", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000b59", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000940", condition()) + ) + ) + Block("1604:l000007a1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000940", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000007e6", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000922", condition()) + ) + ) + Block("1640:l00000922", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l000007e6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000935", condition()) + ) + ) + Block("1660:l000007e6", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000935", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + LocalAssign(Register(R8, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 7bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000822", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000904", condition()) + ) + ) + Block("1700:l00000904", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000822", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000917", condition()) + ) + ) + Block("1720:l00000822", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000917", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/arrays_simple/clang_pic/arrays_simple-before-analysis.il.expected b/src/test/correct/arrays_simple/clang_pic/arrays_simple-before-analysis.il.expected new file mode 100644 index 000000000..5758766d6 --- /dev/null +++ b/src/test/correct/arrays_simple/clang_pic/arrays_simple-before-analysis.il.expected @@ -0,0 +1,310 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000861", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000008c9", condition()) + ) + ) + Block("1752:l000008c9", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000008d7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000008f0", condition()) + ) + ) + Block("1764:l000008f0", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000008d7", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000008e3", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000861", condition()) + ) + ) + Block("1788:l00000861", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1852:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1852:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000acd", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000078b", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000b59", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000940", condition()) + ) + ) + Block("1604:l000007a1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000940", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000007e6", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000922", condition()) + ) + ) + Block("1640:l00000922", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l000007e6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000935", condition()) + ) + ) + Block("1660:l000007e6", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000935", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + LocalAssign(Register(R8, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 7bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000822", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000904", condition()) + ) + ) + Block("1700:l00000904", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000822", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000917", condition()) + ) + ) + Block("1720:l00000822", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000917", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/arrays_simple/gcc_O2/arrays_simple-before-analysis.il.expected b/src/test/correct/arrays_simple/gcc_O2/arrays_simple-before-analysis.il.expected new file mode 100644 index 000000000..82dc9ebf6 --- /dev/null +++ b/src/test/correct/arrays_simple/gcc_O2/arrays_simple-before-analysis.il.expected @@ -0,0 +1,302 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002e7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000310", condition()) + ) + ) + Block("1816:l00000310", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000031e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000337", condition()) + ) + ) + Block("1828:l00000337", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000031e", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000032a", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002e7", condition()) + ) + ) + Block("1852:l000002e7", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l0000051a", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000211", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005ce", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000227", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000387", condition()) + ) + ) + Block("1668:l00000227", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000387", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000026c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000369", condition()) + ) + ) + Block("1704:l00000369", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l0000026c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l0000037c", condition()) + ) + ) + Block("1724:l0000026c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l0000037c", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002a8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000034b", condition()) + ) + ) + Block("1764:l0000034b", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002a8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000035e", condition()) + ) + ) + Block("1784:l000002a8", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000035e", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_arrays_read/clang/basic_arrays_read-before-analysis.il.expected b/src/test/correct/basic_arrays_read/clang/basic_arrays_read-before-analysis.il.expected new file mode 100644 index 000000000..7e1aa608c --- /dev/null +++ b/src/test/correct/basic_arrays_read/clang/basic_arrays_read-before-analysis.il.expected @@ -0,0 +1,307 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002f1", condition()) + ) + ) + Block("1752:l000002f1", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002ff", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000318", condition()) + ) + ) + Block("1764:l00000318", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002ff", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000030b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000029d", condition()) + ) + ) + Block("1788:l0000029d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1840:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004f2", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000059d", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000368", condition()) + ) + ) + Block("1604:l000001dd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000368", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000034a", condition()) + ) + ) + Block("1640:l0000034a", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000035d", condition()) + ) + ) + Block("1660:l00000222", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000035d", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000032c", condition()) + ) + ) + Block("1700:l0000032c", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000033f", condition()) + ) + ) + Block("1720:l0000025e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000033f", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_arrays_read/clang_O2/basic_arrays_read-before-analysis.il.expected b/src/test/correct/basic_arrays_read/clang_O2/basic_arrays_read-before-analysis.il.expected new file mode 100644 index 000000000..6d9c101ec --- /dev/null +++ b/src/test/correct/basic_arrays_read/clang_O2/basic_arrays_read-before-analysis.il.expected @@ -0,0 +1,304 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000291", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002d0", condition()) + ) + ) + Block("1752:l000002d0", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002de", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000002f7", condition()) + ) + ) + Block("1764:l000002f7", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002de", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002ea", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000291", condition()) + ) + ) + Block("1788:l00000291", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1828:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1828:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004ce", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001bb", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000576", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000347", condition()) + ) + ) + Block("1604:l000001d1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000347", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000216", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000329", condition()) + ) + ) + Block("1640:l00000329", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000216", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000033c", condition()) + ) + ) + Block("1660:l00000216", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000033c", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := 0bv32)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000030b", condition()) + ) + ) + Block("1700:l0000030b", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000031e", condition()) + ) + ) + Block("1720:l00000252", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000031e", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_arrays_read/clang_no_plt_no_pic/basic_arrays_read-before-analysis.il.expected b/src/test/correct/basic_arrays_read/clang_no_plt_no_pic/basic_arrays_read-before-analysis.il.expected new file mode 100644 index 000000000..7dec3024b --- /dev/null +++ b/src/test/correct/basic_arrays_read/clang_no_plt_no_pic/basic_arrays_read-before-analysis.il.expected @@ -0,0 +1,307 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000082f", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000883", condition()) + ) + ) + Block("1752:l00000883", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000891", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000008aa", condition()) + ) + ) + Block("1764:l000008aa", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000891", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000089d", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000082f", condition()) + ) + ) + Block("1788:l0000082f", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1840:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000a84", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000759", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000b0d", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000076f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000008fa", condition()) + ) + ) + Block("1604:l0000076f", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000008fa", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000007b4", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000008dc", condition()) + ) + ) + Block("1640:l000008dc", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l000007b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000008ef", condition()) + ) + ) + Block("1660:l000007b4", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000008ef", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000007f0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000008be", condition()) + ) + ) + Block("1700:l000008be", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000007f0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000008d1", condition()) + ) + ) + Block("1720:l000007f0", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000008d1", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_arrays_read/clang_pic/basic_arrays_read-before-analysis.il.expected b/src/test/correct/basic_arrays_read/clang_pic/basic_arrays_read-before-analysis.il.expected new file mode 100644 index 000000000..5581ed4db --- /dev/null +++ b/src/test/correct/basic_arrays_read/clang_pic/basic_arrays_read-before-analysis.il.expected @@ -0,0 +1,308 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002a1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000002fc", condition()) + ) + ) + Block("1816:l000002fc", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) + ), + jumps( + GoTo("1840:l0000030a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000323", condition()) + ) + ) + Block("1828:l00000323", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000030a", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000316", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002a1", condition()) + ) + ) + Block("1852:l000002a1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1908:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1908:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l000004aa", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001cb", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l00000556", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1668:l000001e1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000373", condition()) + ) + ) + Block("1668:l000001e1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000373", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000355", condition()) + ) + ) + Block("1704:l00000355", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) + ), + jumps( + GoTo("1724:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000368", condition()) + ) + ) + Block("1724:l00000226", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000368", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4056bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000337", condition()) + ) + ) + Block("1764:l00000337", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000034a", condition()) + ) + ) + Block("1784:l00000262", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000034a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_arrays_read/gcc/basic_arrays_read-before-analysis.il.expected b/src/test/correct/basic_arrays_read/gcc/basic_arrays_read-before-analysis.il.expected new file mode 100644 index 000000000..8fc7bd546 --- /dev/null +++ b/src/test/correct/basic_arrays_read/gcc/basic_arrays_read-before-analysis.il.expected @@ -0,0 +1,307 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002ef", condition()) + ) + ) + Block("1752:l000002ef", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000002fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000316", condition()) + ) + ) + Block("1764:l00000316", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002fd", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000309", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000029d", condition()) + ) + ) + Block("1788:l0000029d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1840:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004f0", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000059b", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000366", condition()) + ) + ) + Block("1604:l000001dd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000366", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000348", condition()) + ) + ) + Block("1640:l00000348", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000035b", condition()) + ) + ) + Block("1660:l00000222", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000035b", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000032a", condition()) + ) + ) + Block("1700:l0000032a", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000033d", condition()) + ) + ) + Block("1720:l0000025e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000033d", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_arrays_read/gcc_O2/basic_arrays_read-before-analysis.il.expected b/src/test/correct/basic_arrays_read/gcc_O2/basic_arrays_read-before-analysis.il.expected new file mode 100644 index 000000000..b4c451289 --- /dev/null +++ b/src/test/correct/basic_arrays_read/gcc_O2/basic_arrays_read-before-analysis.il.expected @@ -0,0 +1,304 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002ef", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000318", condition()) + ) + ) + Block("1816:l00000318", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l00000326", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000033f", condition()) + ) + ) + Block("1828:l0000033f", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000326", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000332", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002ef", condition()) + ) + ) + Block("1852:l000002ef", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l00000522", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000219", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005d6", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l0000022f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000038f", condition()) + ) + ) + Block("1668:l0000022f", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000038f", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000274", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000371", condition()) + ) + ) + Block("1704:l00000371", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000274", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000384", condition()) + ) + ) + Block("1724:l00000274", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000384", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 24bv64)] := 0bv32)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002b0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000353", condition()) + ) + ) + Block("1764:l00000353", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002b0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000366", condition()) + ) + ) + Block("1784:l000002b0", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000366", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_arrays_read/gcc_no_plt_no_pic/basic_arrays_read-before-analysis.il.expected b/src/test/correct/basic_arrays_read/gcc_no_plt_no_pic/basic_arrays_read-before-analysis.il.expected new file mode 100644 index 000000000..806dca616 --- /dev/null +++ b/src/test/correct/basic_arrays_read/gcc_no_plt_no_pic/basic_arrays_read-before-analysis.il.expected @@ -0,0 +1,307 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000082d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000087f", condition()) + ) + ) + Block("1752:l0000087f", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l0000088d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000008a6", condition()) + ) + ) + Block("1764:l000008a6", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000088d", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000899", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000082d", condition()) + ) + ) + Block("1788:l0000082d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1840:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000a80", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000757", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000b09", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l0000076d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000008f6", condition()) + ) + ) + Block("1604:l0000076d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000008f6", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000007b2", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000008d8", condition()) + ) + ) + Block("1640:l000008d8", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l000007b2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000008eb", condition()) + ) + ) + Block("1660:l000007b2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000008eb", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000007ee", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000008ba", condition()) + ) + ) + Block("1700:l000008ba", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000007ee", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000008cd", condition()) + ) + ) + Block("1720:l000007ee", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000008cd", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_arrays_read/gcc_pic/basic_arrays_read-before-analysis.il.expected b/src/test/correct/basic_arrays_read/gcc_pic/basic_arrays_read-before-analysis.il.expected new file mode 100644 index 000000000..ce0e2bd97 --- /dev/null +++ b/src/test/correct/basic_arrays_read/gcc_pic/basic_arrays_read-before-analysis.il.expected @@ -0,0 +1,307 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000002f1", condition()) + ) + ) + Block("1816:l000002f1", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + ), + jumps( + GoTo("1840:l000002ff", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000318", condition()) + ) + ) + Block("1828:l00000318", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l000002ff", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000030b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l0000029d", condition()) + ) + ) + Block("1852:l0000029d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1904:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1904:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l0000049f", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001c7", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l0000054a", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1668:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000368", condition()) + ) + ) + Block("1668:l000001dd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000368", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000034a", condition()) + ) + ) + Block("1704:l0000034a", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) + ), + jumps( + GoTo("1724:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l0000035d", condition()) + ) + ) + Block("1724:l00000222", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l0000035d", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000032c", condition()) + ) + ) + Block("1764:l0000032c", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000033f", condition()) + ) + ) + Block("1784:l0000025e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000033f", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_arrays_write/clang/basic_arrays_write-before-analysis.il.expected b/src/test/correct/basic_arrays_write/clang/basic_arrays_write-before-analysis.il.expected new file mode 100644 index 000000000..6ac62f93a --- /dev/null +++ b/src/test/correct/basic_arrays_write/clang/basic_arrays_write-before-analysis.il.expected @@ -0,0 +1,309 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000306", condition()) + ) + ) + Block("1752:l00000306", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000314", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000032d", condition()) + ) + ) + Block("1764:l0000032d", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000314", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000320", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002a5", condition()) + ) + ) + Block("1788:l000002a5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1848:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000509", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001cf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005b6", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000037d", condition()) + ) + ) + Block("1604:l000001e5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000037d", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000035f", condition()) + ) + ) + Block("1640:l0000035f", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000372", condition()) + ) + ) + Block("1660:l0000022a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000372", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := BinaryExpr("add", Register(R9, bv64), 52bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000341", condition()) + ) + ) + Block("1700:l00000341", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000354", condition()) + ) + ) + Block("1720:l00000266", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000354", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_arrays_write/clang_O2/basic_arrays_write-before-analysis.il.expected b/src/test/correct/basic_arrays_write/clang_O2/basic_arrays_write-before-analysis.il.expected new file mode 100644 index 000000000..ea40731da --- /dev/null +++ b/src/test/correct/basic_arrays_write/clang_O2/basic_arrays_write-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002db", condition()) + ) + ) + Block("1752:l000002db", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002e9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000302", condition()) + ) + ) + Block("1764:l00000302", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002e9", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002f5", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000295", condition()) + ) + ) + Block("1788:l00000295", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1832:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004da", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001bf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000583", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000352", condition()) + ) + ) + Block("1604:l000001d5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000352", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000334", condition()) + ) + ) + Block("1640:l00000334", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000347", condition()) + ) + ) + Block("1660:l0000021a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000347", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000316", condition()) + ) + ) + Block("1700:l00000316", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000329", condition()) + ) + ) + Block("1720:l00000256", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000329", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_arrays_write/clang_no_plt_no_pic/basic_arrays_write-before-analysis.il.expected b/src/test/correct/basic_arrays_write/clang_no_plt_no_pic/basic_arrays_write-before-analysis.il.expected new file mode 100644 index 000000000..6e50562ef --- /dev/null +++ b/src/test/correct/basic_arrays_write/clang_no_plt_no_pic/basic_arrays_write-before-analysis.il.expected @@ -0,0 +1,309 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000850", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000008b1", condition()) + ) + ) + Block("1752:l000008b1", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000008bf", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000008d8", condition()) + ) + ) + Block("1764:l000008d8", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000008bf", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000008cb", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000850", condition()) + ) + ) + Block("1788:l00000850", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1848:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000ab4", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000077a", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000b3f", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000790", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000928", condition()) + ) + ) + Block("1604:l00000790", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000928", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000007d5", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000090a", condition()) + ) + ) + Block("1640:l0000090a", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l000007d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000091d", condition()) + ) + ) + Block("1660:l000007d5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000091d", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := BinaryExpr("add", Register(R9, bv64), 52bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000811", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000008ec", condition()) + ) + ) + Block("1700:l000008ec", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000811", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000008ff", condition()) + ) + ) + Block("1720:l00000811", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000008ff", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_arrays_write/clang_pic/basic_arrays_write-before-analysis.il.expected b/src/test/correct/basic_arrays_write/clang_pic/basic_arrays_write-before-analysis.il.expected new file mode 100644 index 000000000..69ef2431f --- /dev/null +++ b/src/test/correct/basic_arrays_write/clang_pic/basic_arrays_write-before-analysis.il.expected @@ -0,0 +1,309 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000307", condition()) + ) + ) + Block("1816:l00000307", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) + ), + jumps( + GoTo("1840:l00000315", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000032e", condition()) + ) + ) + Block("1828:l0000032e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000315", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000321", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002a5", condition()) + ) + ) + Block("1852:l000002a5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1912:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1912:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l000004b5", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001cf", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l00000562", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1668:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000037e", condition()) + ) + ) + Block("1668:l000001e5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000037e", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000360", condition()) + ) + ) + Block("1704:l00000360", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) + ), + jumps( + GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000373", condition()) + ) + ) + Block("1724:l0000022a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000373", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4056bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000342", condition()) + ) + ) + Block("1764:l00000342", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000355", condition()) + ) + ) + Block("1784:l00000266", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000355", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_arrays_write/gcc/basic_arrays_write-before-analysis.il.expected b/src/test/correct/basic_arrays_write/gcc/basic_arrays_write-before-analysis.il.expected new file mode 100644 index 000000000..b0202a53d --- /dev/null +++ b/src/test/correct/basic_arrays_write/gcc/basic_arrays_write-before-analysis.il.expected @@ -0,0 +1,309 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000306", condition()) + ) + ) + Block("1752:l00000306", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000314", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000032d", condition()) + ) + ) + Block("1764:l0000032d", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000314", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000320", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002a5", condition()) + ) + ) + Block("1788:l000002a5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1848:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000509", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001cf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005b6", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000037d", condition()) + ) + ) + Block("1604:l000001e5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000037d", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000035f", condition()) + ) + ) + Block("1640:l0000035f", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000372", condition()) + ) + ) + Block("1660:l0000022a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000372", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R0, bv64), 4bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000341", condition()) + ) + ) + Block("1700:l00000341", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000354", condition()) + ) + ) + Block("1720:l00000266", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000354", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_arrays_write/gcc_O2/basic_arrays_write-before-analysis.il.expected b/src/test/correct/basic_arrays_write/gcc_O2/basic_arrays_write-before-analysis.il.expected new file mode 100644 index 000000000..1c750f3dd --- /dev/null +++ b/src/test/correct/basic_arrays_write/gcc_O2/basic_arrays_write-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f4", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000031d", condition()) + ) + ) + Block("1816:l0000031d", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000032b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000344", condition()) + ) + ) + Block("1828:l00000344", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000032b", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000337", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f4", condition()) + ) + ) + Block("1852:l000002f4", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l00000527", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l0000021e", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005db", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000234", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000394", condition()) + ) + ) + Block("1668:l00000234", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000394", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000279", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000376", condition()) + ) + ) + Block("1704:l00000376", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000279", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000389", condition()) + ) + ) + Block("1724:l00000279", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000389", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R2, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 28bv64)] := Extract(Register(R2, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002b5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000358", condition()) + ) + ) + Block("1764:l00000358", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002b5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000036b", condition()) + ) + ) + Block("1784:l000002b5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000036b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_arrays_write/gcc_no_plt_no_pic/basic_arrays_write-before-analysis.il.expected b/src/test/correct/basic_arrays_write/gcc_no_plt_no_pic/basic_arrays_write-before-analysis.il.expected new file mode 100644 index 000000000..0348623ae --- /dev/null +++ b/src/test/correct/basic_arrays_write/gcc_no_plt_no_pic/basic_arrays_write-before-analysis.il.expected @@ -0,0 +1,309 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000850", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000008b1", condition()) + ) + ) + Block("1752:l000008b1", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000008bf", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000008d8", condition()) + ) + ) + Block("1764:l000008d8", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000008bf", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000008cb", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000850", condition()) + ) + ) + Block("1788:l00000850", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1848:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000ab4", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000077a", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000b3f", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000790", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000928", condition()) + ) + ) + Block("1604:l00000790", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000928", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000007d5", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000090a", condition()) + ) + ) + Block("1640:l0000090a", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l000007d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000091d", condition()) + ) + ) + Block("1660:l000007d5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000091d", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R0, bv64), 4bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000811", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000008ec", condition()) + ) + ) + Block("1700:l000008ec", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000811", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000008ff", condition()) + ) + ) + Block("1720:l00000811", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000008ff", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_arrays_write/gcc_pic/basic_arrays_write-before-analysis.il.expected b/src/test/correct/basic_arrays_write/gcc_pic/basic_arrays_write-before-analysis.il.expected new file mode 100644 index 000000000..a20b05a7e --- /dev/null +++ b/src/test/correct/basic_arrays_write/gcc_pic/basic_arrays_write-before-analysis.il.expected @@ -0,0 +1,309 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000307", condition()) + ) + ) + Block("1816:l00000307", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + ), + jumps( + GoTo("1840:l00000315", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000032e", condition()) + ) + ) + Block("1828:l0000032e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000315", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000321", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002a5", condition()) + ) + ) + Block("1852:l000002a5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1912:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1912:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l000004b5", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001cf", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l00000562", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1668:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000037e", condition()) + ) + ) + Block("1668:l000001e5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000037e", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000360", condition()) + ) + ) + Block("1704:l00000360", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) + ), + jumps( + GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000373", condition()) + ) + ) + Block("1724:l0000022a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000373", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R0, bv64), 4bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000342", condition()) + ) + ) + Block("1764:l00000342", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000355", condition()) + ) + ) + Block("1784:l00000266", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000355", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_assign_assign/clang/basic_assign_assign-before-analysis.il.expected b/src/test/correct/basic_assign_assign/clang/basic_assign_assign-before-analysis.il.expected new file mode 100644 index 000000000..ce52ab33b --- /dev/null +++ b/src/test/correct/basic_assign_assign/clang/basic_assign_assign-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002da", condition()) + ) + ) + Block("1752:l000002da", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000301", condition()) + ) + ) + Block("1764:l00000301", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002e8", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002f4", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000295", condition()) + ) + ) + Block("1788:l00000295", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1832:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004d9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001bf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000582", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000351", condition()) + ) + ) + Block("1604:l000001d5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000351", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000333", condition()) + ) + ) + Block("1640:l00000333", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000346", condition()) + ) + ) + Block("1660:l0000021a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000346", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000315", condition()) + ) + ) + Block("1700:l00000315", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000328", condition()) + ) + ) + Block("1720:l00000256", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000328", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_assign_assign/clang_O2/basic_assign_assign-before-analysis.il.expected b/src/test/correct/basic_assign_assign/clang_O2/basic_assign_assign-before-analysis.il.expected new file mode 100644 index 000000000..d6959f31d --- /dev/null +++ b/src/test/correct/basic_assign_assign/clang_O2/basic_assign_assign-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002da", condition()) + ) + ) + Block("1752:l000002da", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000301", condition()) + ) + ) + Block("1764:l00000301", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002e8", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002f4", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000295", condition()) + ) + ) + Block("1788:l00000295", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1832:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004d9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001bf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000582", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000351", condition()) + ) + ) + Block("1604:l000001d5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000351", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000333", condition()) + ) + ) + Block("1640:l00000333", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000346", condition()) + ) + ) + Block("1660:l0000021a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000346", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 5bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000315", condition()) + ) + ) + Block("1700:l00000315", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000328", condition()) + ) + ) + Block("1720:l00000256", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000328", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_assign_assign/clang_no_plt_no_pic/basic_assign_assign-before-analysis.il.expected b/src/test/correct/basic_assign_assign/clang_no_plt_no_pic/basic_assign_assign-before-analysis.il.expected new file mode 100644 index 000000000..6355e69c7 --- /dev/null +++ b/src/test/correct/basic_assign_assign/clang_no_plt_no_pic/basic_assign_assign-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000080c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000851", condition()) + ) + ) + Block("1752:l00000851", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000085f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000878", condition()) + ) + ) + Block("1764:l00000878", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000085f", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000086b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000080c", condition()) + ) + ) + Block("1788:l0000080c", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1832:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000a50", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000736", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000ad7", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000074c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000008c8", condition()) + ) + ) + Block("1604:l0000074c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000008c8", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000008aa", condition()) + ) + ) + Block("1640:l000008aa", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000008bd", condition()) + ) + ) + Block("1660:l00000791", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000008bd", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000088c", condition()) + ) + ) + Block("1700:l0000088c", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000089f", condition()) + ) + ) + Block("1720:l000007cd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000089f", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_assign_assign/clang_pic/basic_assign_assign-before-analysis.il.expected b/src/test/correct/basic_assign_assign/clang_pic/basic_assign_assign-before-analysis.il.expected new file mode 100644 index 000000000..96265d4b8 --- /dev/null +++ b/src/test/correct/basic_assign_assign/clang_pic/basic_assign_assign-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000002e5", condition()) + ) + ) + Block("1816:l000002e5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) + ), + jumps( + GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000030c", condition()) + ) + ) + Block("1828:l0000030c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l000002f3", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000002ff", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l00000299", condition()) + ) + ) + Block("1852:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1900:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l00000493", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l0000053d", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000035c", condition()) + ) + ) + Block("1668:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000035c", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000033e", condition()) + ) + ) + Block("1704:l0000033e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000351", condition()) + ) + ) + Block("1724:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000351", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4040bv64)])) + LocalAssign(Register(R8, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000320", condition()) + ) + ) + Block("1764:l00000320", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000333", condition()) + ) + ) + Block("1784:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000333", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_assign_assign/gcc/basic_assign_assign-before-analysis.il.expected b/src/test/correct/basic_assign_assign/gcc/basic_assign_assign-before-analysis.il.expected new file mode 100644 index 000000000..fca0ff5bf --- /dev/null +++ b/src/test/correct/basic_assign_assign/gcc/basic_assign_assign-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002e4", condition()) + ) + ) + Block("1752:l000002e4", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000002f2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000030b", condition()) + ) + ) + Block("1764:l0000030b", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002f2", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002fe", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000299", condition()) + ) + ) + Block("1788:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004e4", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000058e", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000035b", condition()) + ) + ) + Block("1604:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000035b", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000033d", condition()) + ) + ) + Block("1640:l0000033d", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000350", condition()) + ) + ) + Block("1660:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000350", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000031f", condition()) + ) + ) + Block("1700:l0000031f", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000332", condition()) + ) + ) + Block("1720:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000332", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_assign_assign/gcc_O2/basic_assign_assign-before-analysis.il.expected b/src/test/correct/basic_assign_assign/gcc_O2/basic_assign_assign-before-analysis.il.expected new file mode 100644 index 000000000..40a431627 --- /dev/null +++ b/src/test/correct/basic_assign_assign/gcc_O2/basic_assign_assign-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f3", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000031c", condition()) + ) + ) + Block("1816:l0000031c", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000032a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000343", condition()) + ) + ) + Block("1828:l00000343", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000032a", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000336", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f3", condition()) + ) + ) + Block("1852:l000002f3", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l00000526", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l0000021d", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005da", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000233", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000393", condition()) + ) + ) + Block("1668:l00000233", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000393", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000375", condition()) + ) + ) + Block("1704:l00000375", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000388", condition()) + ) + ) + Block("1724:l00000278", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000388", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R2, bv64) := 5bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R2, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000357", condition()) + ) + ) + Block("1764:l00000357", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000036a", condition()) + ) + ) + Block("1784:l000002b4", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000036a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_assign_assign/gcc_no_plt_no_pic/basic_assign_assign-before-analysis.il.expected b/src/test/correct/basic_assign_assign/gcc_no_plt_no_pic/basic_assign_assign-before-analysis.il.expected new file mode 100644 index 000000000..0d3942cca --- /dev/null +++ b/src/test/correct/basic_assign_assign/gcc_no_plt_no_pic/basic_assign_assign-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000081c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000867", condition()) + ) + ) + Block("1752:l00000867", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000088e", condition()) + ) + ) + Block("1764:l0000088e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000875", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000881", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000081c", condition()) + ) + ) + Block("1788:l0000081c", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000a67", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000746", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000aef", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l0000075c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000008de", condition()) + ) + ) + Block("1604:l0000075c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000008de", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000008c0", condition()) + ) + ) + Block("1640:l000008c0", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000008d3", condition()) + ) + ) + Block("1660:l000007a1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000008d3", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000008a2", condition()) + ) + ) + Block("1700:l000008a2", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000008b5", condition()) + ) + ) + Block("1720:l000007dd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000008b5", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_assign_assign/gcc_pic/basic_assign_assign-before-analysis.il.expected b/src/test/correct/basic_assign_assign/gcc_pic/basic_assign_assign-before-analysis.il.expected new file mode 100644 index 000000000..63a483b36 --- /dev/null +++ b/src/test/correct/basic_assign_assign/gcc_pic/basic_assign_assign-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000002e5", condition()) + ) + ) + Block("1816:l000002e5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + ), + jumps( + GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000030c", condition()) + ) + ) + Block("1828:l0000030c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l000002f3", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000002ff", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l00000299", condition()) + ) + ) + Block("1852:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1900:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l00000493", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l0000053d", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000035c", condition()) + ) + ) + Block("1668:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000035c", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000033e", condition()) + ) + ) + Block("1704:l0000033e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000351", condition()) + ) + ) + Block("1724:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000351", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R1, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000320", condition()) + ) + ) + Block("1764:l00000320", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000333", condition()) + ) + ) + Block("1784:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000333", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_assign_increment/clang/basic_assign_increment-before-analysis.il.expected b/src/test/correct/basic_assign_increment/clang/basic_assign_increment-before-analysis.il.expected new file mode 100644 index 000000000..745874097 --- /dev/null +++ b/src/test/correct/basic_assign_increment/clang/basic_assign_increment-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002e6", condition()) + ) + ) + Block("1752:l000002e6", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002f4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000030d", condition()) + ) + ) + Block("1764:l0000030d", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002f4", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000300", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000299", condition()) + ) + ) + Block("1788:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004e6", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000590", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000035d", condition()) + ) + ) + Block("1604:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000035d", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000033f", condition()) + ) + ) + Block("1640:l0000033f", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000352", condition()) + ) + ) + Block("1660:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000352", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000321", condition()) + ) + ) + Block("1700:l00000321", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000334", condition()) + ) + ) + Block("1720:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000334", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_assign_increment/clang_O2/basic_assign_increment-before-analysis.il.expected b/src/test/correct/basic_assign_increment/clang_O2/basic_assign_increment-before-analysis.il.expected new file mode 100644 index 000000000..6175f2547 --- /dev/null +++ b/src/test/correct/basic_assign_increment/clang_O2/basic_assign_increment-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002e6", condition()) + ) + ) + Block("1752:l000002e6", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002f4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000030d", condition()) + ) + ) + Block("1764:l0000030d", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002f4", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000300", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000299", condition()) + ) + ) + Block("1788:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004e6", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000590", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000035d", condition()) + ) + ) + Block("1604:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000035d", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000033f", condition()) + ) + ) + Block("1640:l0000033f", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000352", condition()) + ) + ) + Block("1660:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000352", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(Register(R9, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R9, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000321", condition()) + ) + ) + Block("1700:l00000321", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000334", condition()) + ) + ) + Block("1720:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000334", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_assign_increment/clang_no_plt_no_pic/basic_assign_increment-before-analysis.il.expected b/src/test/correct/basic_assign_increment/clang_no_plt_no_pic/basic_assign_increment-before-analysis.il.expected new file mode 100644 index 000000000..03ca075b4 --- /dev/null +++ b/src/test/correct/basic_assign_increment/clang_no_plt_no_pic/basic_assign_increment-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000081e", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000086b", condition()) + ) + ) + Block("1752:l0000086b", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000879", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000892", condition()) + ) + ) + Block("1764:l00000892", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000879", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000885", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000081e", condition()) + ) + ) + Block("1788:l0000081e", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000a6b", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000748", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000af3", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000075e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000008e2", condition()) + ) + ) + Block("1604:l0000075e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000008e2", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000007a3", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000008c4", condition()) + ) + ) + Block("1640:l000008c4", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l000007a3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000008d7", condition()) + ) + ) + Block("1660:l000007a3", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000008d7", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000007df", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000008a6", condition()) + ) + ) + Block("1700:l000008a6", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000007df", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000008b9", condition()) + ) + ) + Block("1720:l000007df", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000008b9", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_assign_increment/clang_pic/basic_assign_increment-before-analysis.il.expected b/src/test/correct/basic_assign_increment/clang_pic/basic_assign_increment-before-analysis.il.expected new file mode 100644 index 000000000..8faec5e6c --- /dev/null +++ b/src/test/correct/basic_assign_increment/clang_pic/basic_assign_increment-before-analysis.il.expected @@ -0,0 +1,307 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000002f1", condition()) + ) + ) + Block("1816:l000002f1", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) + ), + jumps( + GoTo("1840:l000002ff", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000318", condition()) + ) + ) + Block("1828:l00000318", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l000002ff", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000030b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l0000029d", condition()) + ) + ) + Block("1852:l0000029d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1904:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1904:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l0000049f", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001c7", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l0000054a", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000368", condition()) + ) + ) + Block("1668:l000001dd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000368", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000034a", condition()) + ) + ) + Block("1704:l0000034a", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) + ), + jumps( + GoTo("1724:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l0000035d", condition()) + ) + ) + Block("1724:l00000222", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l0000035d", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4040bv64)])) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R9, bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000032c", condition()) + ) + ) + Block("1764:l0000032c", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000033f", condition()) + ) + ) + Block("1784:l0000025e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000033f", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_assign_increment/gcc/basic_assign_increment-before-analysis.il.expected b/src/test/correct/basic_assign_increment/gcc/basic_assign_increment-before-analysis.il.expected new file mode 100644 index 000000000..d942c4643 --- /dev/null +++ b/src/test/correct/basic_assign_increment/gcc/basic_assign_increment-before-analysis.il.expected @@ -0,0 +1,309 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000303", condition()) + ) + ) + Block("1752:l00000303", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000311", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000032a", condition()) + ) + ) + Block("1764:l0000032a", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000311", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000031d", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002a5", condition()) + ) + ) + Block("1788:l000002a5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1848:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000506", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001cf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005b3", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000037a", condition()) + ) + ) + Block("1604:l000001e5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000037a", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000035c", condition()) + ) + ) + Block("1640:l0000035c", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000036f", condition()) + ) + ) + Block("1660:l0000022a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000036f", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000033e", condition()) + ) + ) + Block("1700:l0000033e", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000351", condition()) + ) + ) + Block("1720:l00000266", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000351", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_assign_increment/gcc_O2/basic_assign_increment-before-analysis.il.expected b/src/test/correct/basic_assign_increment/gcc_O2/basic_assign_increment-before-analysis.il.expected new file mode 100644 index 000000000..7bf4d0eee --- /dev/null +++ b/src/test/correct/basic_assign_increment/gcc_O2/basic_assign_increment-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000322", condition()) + ) + ) + Block("1816:l00000322", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l00000330", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000349", condition()) + ) + ) + Block("1828:l00000349", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000330", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000033c", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f9", condition()) + ) + ) + Block("1852:l000002f9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l0000052c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000223", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005e0", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000239", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000399", condition()) + ) + ) + Block("1668:l00000239", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000399", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000037b", condition()) + ) + ) + Block("1704:l0000037b", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l0000038e", condition()) + ) + ) + Block("1724:l0000027e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l0000038e", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R2, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 20bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R1, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R2, bv64), 20bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000035d", condition()) + ) + ) + Block("1764:l0000035d", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000370", condition()) + ) + ) + Block("1784:l000002ba", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000370", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_assign_increment/gcc_no_plt_no_pic/basic_assign_increment-before-analysis.il.expected b/src/test/correct/basic_assign_increment/gcc_no_plt_no_pic/basic_assign_increment-before-analysis.il.expected new file mode 100644 index 000000000..619da9a78 --- /dev/null +++ b/src/test/correct/basic_assign_increment/gcc_no_plt_no_pic/basic_assign_increment-before-analysis.il.expected @@ -0,0 +1,309 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000084d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000008ab", condition()) + ) + ) + Block("1752:l000008ab", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000008b9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000008d2", condition()) + ) + ) + Block("1764:l000008d2", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000008b9", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000008c5", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000084d", condition()) + ) + ) + Block("1788:l0000084d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1848:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000aae", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000777", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000b39", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l0000078d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000922", condition()) + ) + ) + Block("1604:l0000078d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000922", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000007d2", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000904", condition()) + ) + ) + Block("1640:l00000904", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l000007d2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000917", condition()) + ) + ) + Block("1660:l000007d2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000917", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000080e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000008e6", condition()) + ) + ) + Block("1700:l000008e6", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000080e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000008f9", condition()) + ) + ) + Block("1720:l0000080e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000008f9", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_assign_increment/gcc_pic/basic_assign_increment-before-analysis.il.expected b/src/test/correct/basic_assign_increment/gcc_pic/basic_assign_increment-before-analysis.il.expected new file mode 100644 index 000000000..5b65dd499 --- /dev/null +++ b/src/test/correct/basic_assign_increment/gcc_pic/basic_assign_increment-before-analysis.il.expected @@ -0,0 +1,309 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000305", condition()) + ) + ) + Block("1816:l00000305", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + ), + jumps( + GoTo("1840:l00000313", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000032c", condition()) + ) + ) + Block("1828:l0000032c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000313", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000031f", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002a5", condition()) + ) + ) + Block("1852:l000002a5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1912:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1912:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l000004b3", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001cf", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l00000560", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000037c", condition()) + ) + ) + Block("1668:l000001e5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000037c", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000035e", condition()) + ) + ) + Block("1704:l0000035e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) + ), + jumps( + GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000371", condition()) + ) + ) + Block("1724:l0000022a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000371", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000340", condition()) + ) + ) + Block("1764:l00000340", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000353", condition()) + ) + ) + Block("1784:l00000266", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000353", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_function_call_caller/clang/basic_function_call_caller-before-analysis.il.expected b/src/test/correct/basic_function_call_caller/clang/basic_function_call_caller-before-analysis.il.expected new file mode 100644 index 000000000..522d30df5 --- /dev/null +++ b/src/test/correct/basic_function_call_caller/clang/basic_function_call_caller-before-analysis.il.expected @@ -0,0 +1,335 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002c1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000362", condition()) + ) + ) + Block("1752:l00000362", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000370", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000389", condition()) + ) + ) + Block("1764:l00000389", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000370", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000037c", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002c1", condition()) + ) + ) + Block("1788:l000002c1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l0000056c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001eb", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000622", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000201", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003d9", condition()) + ) + ) + Block("1604:l00000201", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003d9", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003bb", condition()) + ) + ) + Block("1640:l000003bb", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003ce", condition()) + ) + ) + Block("1660:l00000246", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003ce", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1820:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1820:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1812:zero", condition()) + ) + ) + Block("1840:l00000321", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)]), 32)) + LocalAssign(Register(R9, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000039d", condition()) + ) + ) + Block("1700:l0000039d", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003b0", condition()) + ) + ) + Block("1720:l00000282", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003b0", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1812:zero", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1812:lzero", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_function_call_caller/clang_O2/basic_function_call_caller-before-analysis.il.expected b/src/test/correct/basic_function_call_caller/clang_O2/basic_function_call_caller-before-analysis.il.expected new file mode 100644 index 000000000..bbeb26f15 --- /dev/null +++ b/src/test/correct/basic_function_call_caller/clang_O2/basic_function_call_caller-before-analysis.il.expected @@ -0,0 +1,317 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000301", condition()) + ) + ) + Block("1752:l00000301", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000030f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000328", condition()) + ) + ) + Block("1764:l00000328", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000030f", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000031b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002a5", condition()) + ) + ) + Block("1788:l000002a5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1848:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000504", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001cf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005b3", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000378", condition()) + ) + ) + Block("1604:l000001e5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000378", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000035a", condition()) + ) + ) + Block("1640:l0000035a", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000036d", condition()) + ) + ) + Block("1660:l0000022a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000036d", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1820:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1820:lmain", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R10, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R10, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000033c", condition()) + ) + ) + Block("1700:l0000033c", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000034f", condition()) + ) + ) + Block("1720:l00000266", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000034f", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1812:zero", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1812:lzero", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_function_call_caller/clang_no_plt_no_pic/basic_function_call_caller-before-analysis.il.expected b/src/test/correct/basic_function_call_caller/clang_no_plt_no_pic/basic_function_call_caller-before-analysis.il.expected new file mode 100644 index 000000000..50f29a019 --- /dev/null +++ b/src/test/correct/basic_function_call_caller/clang_no_plt_no_pic/basic_function_call_caller-before-analysis.il.expected @@ -0,0 +1,335 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008d8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000979", condition()) + ) + ) + Block("1752:l00000979", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000987", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009a0", condition()) + ) + ) + Block("1764:l000009a0", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000987", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000993", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008d8", condition()) + ) + ) + Block("1788:l000008d8", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b83", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000802", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c15", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000818", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000009f0", condition()) + ) + ) + Block("1604:l00000818", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000009f0", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009d2", condition()) + ) + ) + Block("1640:l000009d2", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009e5", condition()) + ) + ) + Block("1660:l0000085d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009e5", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1820:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1820:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1812:zero", condition()) + ) + ) + Block("1840:l00000938", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)]), 32)) + LocalAssign(Register(R9, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000899", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009b4", condition()) + ) + ) + Block("1700:l000009b4", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000899", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009c7", condition()) + ) + ) + Block("1720:l00000899", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009c7", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1812:zero", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1812:lzero", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_function_call_caller/clang_pic/basic_function_call_caller-before-analysis.il.expected b/src/test/correct/basic_function_call_caller/clang_pic/basic_function_call_caller-before-analysis.il.expected new file mode 100644 index 000000000..13f46bf3a --- /dev/null +++ b/src/test/correct/basic_function_call_caller/clang_pic/basic_function_call_caller-before-analysis.il.expected @@ -0,0 +1,337 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002c9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000378", condition()) + ) + ) + Block("1816:l00000378", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) + ), + jumps( + GoTo("1840:l00000386", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000039f", condition()) + ) + ) + Block("1828:l0000039f", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000386", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000392", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002c9", condition()) + ) + ) + Block("1852:l000002c9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1948:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1948:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l00000526", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001f3", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l000005c5", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1668:l00000209", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003ef", condition()) + ) + ) + Block("1668:l00000209", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003ef", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003d1", condition()) + ) + ) + Block("1704:l000003d1", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) + ), + jumps( + GoTo("1724:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003e4", condition()) + ) + ) + Block("1724:l0000024e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003e4", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1884:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1884:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 1904bv64) + ), + jumps( + DirectCall("1876:zero", condition()) + ) + ) + Block("1904:l00000329", + statements( + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)]), 32)) + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4048bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003b3", condition()) + ) + ) + Block("1764:l000003b3", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003c6", condition()) + ) + ) + Block("1784:l0000028a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003c6", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1876:zero", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:lzero", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_function_call_caller/gcc/basic_function_call_caller-before-analysis.il.expected b/src/test/correct/basic_function_call_caller/gcc/basic_function_call_caller-before-analysis.il.expected new file mode 100644 index 000000000..42dc02325 --- /dev/null +++ b/src/test/correct/basic_function_call_caller/gcc/basic_function_call_caller-before-analysis.il.expected @@ -0,0 +1,337 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000370", condition()) + ) + ) + Block("1752:l00000370", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l0000037e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000397", condition()) + ) + ) + Block("1764:l00000397", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000037e", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000038a", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002c5", condition()) + ) + ) + Block("1788:l000002c5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1880:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1880:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l0000057b", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001ef", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000632", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003e7", condition()) + ) + ) + Block("1604:l00000205", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003e7", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003c9", condition()) + ) + ) + Block("1640:l000003c9", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003dc", condition()) + ) + ) + Block("1660:l0000024a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003dc", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1820:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1820:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 1836bv64) + ), + jumps( + DirectCall("1812:zero", condition()) + ) + ) + Block("1836:l00000323", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003ab", condition()) + ) + ) + Block("1700:l000003ab", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003be", condition()) + ) + ) + Block("1720:l00000286", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003be", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1812:zero", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1812:lzero", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_function_call_caller/gcc_O2/basic_function_call_caller-before-analysis.il.expected b/src/test/correct/basic_function_call_caller/gcc_O2/basic_function_call_caller-before-analysis.il.expected new file mode 100644 index 000000000..0d1e3357c --- /dev/null +++ b/src/test/correct/basic_function_call_caller/gcc_O2/basic_function_call_caller-before-analysis.il.expected @@ -0,0 +1,317 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l00000311", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000034a", condition()) + ) + ) + Block("1816:l0000034a", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l00000358", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000371", condition()) + ) + ) + Block("1828:l00000371", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000358", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000364", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l00000311", condition()) + ) + ) + Block("1852:l00000311", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1896:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l00000559", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l0000023b", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000614", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000251", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003c1", condition()) + ) + ) + Block("1668:l00000251", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003c1", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003a3", condition()) + ) + ) + Block("1704:l000003a3", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003b6", condition()) + ) + ) + Block("1724:l00000296", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003b6", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) + LocalAssign(Register(R3, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R2, bv64), 4bv64)] := Extract(Register(R3, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002d2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000385", condition()) + ) + ) + Block("1764:l00000385", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002d2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000398", condition()) + ) + ) + Block("1784:l000002d2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000398", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1888:zero", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1888:lzero", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_function_call_caller/gcc_no_plt_no_pic/basic_function_call_caller-before-analysis.il.expected b/src/test/correct/basic_function_call_caller/gcc_no_plt_no_pic/basic_function_call_caller-before-analysis.il.expected new file mode 100644 index 000000000..70876d0cc --- /dev/null +++ b/src/test/correct/basic_function_call_caller/gcc_no_plt_no_pic/basic_function_call_caller-before-analysis.il.expected @@ -0,0 +1,337 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008ec", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000997", condition()) + ) + ) + Block("1752:l00000997", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000009a5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009be", condition()) + ) + ) + Block("1764:l000009be", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000009a5", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009b1", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008ec", condition()) + ) + ) + Block("1788:l000008ec", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1880:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1880:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000ba2", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000816", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c35", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l0000082c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a0e", condition()) + ) + ) + Block("1604:l0000082c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a0e", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000871", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009f0", condition()) + ) + ) + Block("1640:l000009f0", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000871", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a03", condition()) + ) + ) + Block("1660:l00000871", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a03", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1820:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1820:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 1836bv64) + ), + jumps( + DirectCall("1812:zero", condition()) + ) + ) + Block("1836:l0000094a", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008ad", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009d2", condition()) + ) + ) + Block("1700:l000009d2", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000008ad", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009e5", condition()) + ) + ) + Block("1720:l000008ad", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009e5", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1812:zero", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1812:lzero", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_function_call_caller/gcc_pic/basic_function_call_caller-before-analysis.il.expected b/src/test/correct/basic_function_call_caller/gcc_pic/basic_function_call_caller-before-analysis.il.expected new file mode 100644 index 000000000..f58471812 --- /dev/null +++ b/src/test/correct/basic_function_call_caller/gcc_pic/basic_function_call_caller-before-analysis.il.expected @@ -0,0 +1,337 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000372", condition()) + ) + ) + Block("1816:l00000372", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1840:l00000380", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000399", condition()) + ) + ) + Block("1828:l00000399", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000380", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000038c", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002c5", condition()) + ) + ) + Block("1852:l000002c5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1944:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l00000520", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001ef", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l000005be", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003e9", condition()) + ) + ) + Block("1668:l00000205", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003e9", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003cb", condition()) + ) + ) + Block("1704:l000003cb", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003de", condition()) + ) + ) + Block("1724:l0000024a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003de", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1884:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1884:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 1900bv64) + ), + jumps( + DirectCall("1876:zero", condition()) + ) + ) + Block("1900:l00000323", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003ad", condition()) + ) + ) + Block("1764:l000003ad", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003c0", condition()) + ) + ) + Block("1784:l00000286", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003c0", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1876:zero", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:lzero", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_function_call_reader/clang/basic_function_call_reader-before-analysis.il.expected b/src/test/correct/basic_function_call_reader/clang/basic_function_call_reader-before-analysis.il.expected new file mode 100644 index 000000000..c042eecd7 --- /dev/null +++ b/src/test/correct/basic_function_call_reader/clang/basic_function_call_reader-before-analysis.il.expected @@ -0,0 +1,372 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002cd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000389", condition()) + ) + ) + Block("1752:l00000389", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000397", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003b0", condition()) + ) + ) + Block("1764:l000003b0", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000397", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000003a3", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002cd", condition()) + ) + ) + Block("1788:l000002cd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1888:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1888:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000596", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001f7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000064e", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000020d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000400", condition()) + ) + ) + Block("1604:l0000020d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000400", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003e2", condition()) + ) + ) + Block("1640:l000003e2", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003f5", condition()) + ) + ) + Block("1660:l00000252", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003f5", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000342", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000345", condition()) + ) + ) + Block("?:l00000345", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000348", condition()) + ) + ) + Block("?:l00000342", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000348", condition()) + ) + ) + Block("?:l00000348", + statements( + ), + jumps( + GoTo("1864:l00000350", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1852:l0000037a", condition()) + ) + ) + Block("1864:l00000350", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1876:l00000365", condition()) + ) + ) + Block("1852:l0000037a", + statements( + ), + jumps( + GoTo("1856:l0000037b", condition()) + ) + ) + Block("1856:l0000037b", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + ), + jumps( + GoTo("1876:l00000365", condition()) + ) + ) + Block("1876:l00000365", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003c4", condition()) + ) + ) + Block("1700:l000003c4", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003d7", condition()) + ) + ) + Block("1720:l0000028e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003d7", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_function_call_reader/clang_O2/basic_function_call_reader-before-analysis.il.expected b/src/test/correct/basic_function_call_reader/clang_O2/basic_function_call_reader-before-analysis.il.expected new file mode 100644 index 000000000..d3af82e52 --- /dev/null +++ b/src/test/correct/basic_function_call_reader/clang_O2/basic_function_call_reader-before-analysis.il.expected @@ -0,0 +1,334 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000030b", condition()) + ) + ) + Block("1752:l0000030b", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000319", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000332", condition()) + ) + ) + Block("1764:l00000332", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000319", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000325", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000029d", condition()) + ) + ) + Block("1788:l0000029d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1840:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l0000050c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005b7", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000382", condition()) + ) + ) + Block("1604:l000001dd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000382", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000364", condition()) + ) + ) + Block("1640:l00000364", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000377", condition()) + ) + ) + Block("1660:l00000222", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000377", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("?:l000002f9", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l000002fd", condition()) + ) + ) + Block("?:l000002fd", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(Extract(Register(R9, bv64)[32:0]), 32)) + ), + jumps( + GoTo("?:l00000300", condition()) + ) + ) + Block("?:l000002f9", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000300", condition()) + ) + ) + Block("?:l00000300", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000346", condition()) + ) + ) + Block("1700:l00000346", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000359", condition()) + ) + ) + Block("1720:l0000025e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000359", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_function_call_reader/clang_no_plt_no_pic/basic_function_call_reader-before-analysis.il.expected b/src/test/correct/basic_function_call_reader/clang_no_plt_no_pic/basic_function_call_reader-before-analysis.il.expected new file mode 100644 index 000000000..e3ec18803 --- /dev/null +++ b/src/test/correct/basic_function_call_reader/clang_no_plt_no_pic/basic_function_call_reader-before-analysis.il.expected @@ -0,0 +1,372 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000910", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000009cc", condition()) + ) + ) + Block("1752:l000009cc", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000009da", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009f3", condition()) + ) + ) + Block("1764:l000009f3", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000009da", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009e6", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000910", condition()) + ) + ) + Block("1788:l00000910", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1888:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1888:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000bd9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000083a", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c6e", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000850", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a43", condition()) + ) + ) + Block("1604:l00000850", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a43", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000895", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000a25", condition()) + ) + ) + Block("1640:l00000a25", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000895", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a38", condition()) + ) + ) + Block("1660:l00000895", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a38", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000985", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000988", condition()) + ) + ) + Block("?:l00000988", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l0000098b", condition()) + ) + ) + Block("?:l00000985", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l0000098b", condition()) + ) + ) + Block("?:l0000098b", + statements( + ), + jumps( + GoTo("1864:l00000993", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1852:l000009bd", condition()) + ) + ) + Block("1864:l00000993", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1876:l000009a8", condition()) + ) + ) + Block("1852:l000009bd", + statements( + ), + jumps( + GoTo("1856:l000009be", condition()) + ) + ) + Block("1856:l000009be", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + ), + jumps( + GoTo("1876:l000009a8", condition()) + ) + ) + Block("1876:l000009a8", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000a07", condition()) + ) + ) + Block("1700:l00000a07", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000008d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000a1a", condition()) + ) + ) + Block("1720:l000008d1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000a1a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_function_call_reader/clang_pic/basic_function_call_reader-before-analysis.il.expected b/src/test/correct/basic_function_call_reader/clang_pic/basic_function_call_reader-before-analysis.il.expected new file mode 100644 index 000000000..75641545a --- /dev/null +++ b/src/test/correct/basic_function_call_reader/clang_pic/basic_function_call_reader-before-analysis.il.expected @@ -0,0 +1,374 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000039f", condition()) + ) + ) + Block("1816:l0000039f", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) + ), + jumps( + GoTo("1840:l000003ad", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l000003c6", condition()) + ) + ) + Block("1828:l000003c6", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l000003ad", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000003b9", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002d5", condition()) + ) + ) + Block("1852:l000002d5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1960:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1960:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l0000054d", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001ff", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l000005ee", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1668:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000416", condition()) + ) + ) + Block("1668:l00000215", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000416", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003f8", condition()) + ) + ) + Block("1704:l000003f8", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) + ), + jumps( + GoTo("1724:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l0000040b", condition()) + ) + ) + Block("1724:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l0000040b", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4048bv64)])) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000358", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l0000035b", condition()) + ) + ) + Block("?:l0000035b", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l0000035e", condition()) + ) + ) + Block("?:l00000358", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l0000035e", condition()) + ) + ) + Block("?:l0000035e", + statements( + ), + jumps( + GoTo("1936:l00000366", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1924:l00000390", condition()) + ) + ) + Block("1936:l00000366", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1948:l0000037b", condition()) + ) + ) + Block("1924:l00000390", + statements( + ), + jumps( + GoTo("1928:l00000391", condition()) + ) + ) + Block("1928:l00000391", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + ), + jumps( + GoTo("1948:l0000037b", condition()) + ) + ) + Block("1948:l0000037b", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003da", condition()) + ) + ) + Block("1764:l000003da", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003ed", condition()) + ) + ) + Block("1784:l00000296", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003ed", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_function_call_reader/gcc/basic_function_call_reader-before-analysis.il.expected b/src/test/correct/basic_function_call_reader/gcc/basic_function_call_reader-before-analysis.il.expected new file mode 100644 index 000000000..18dd59731 --- /dev/null +++ b/src/test/correct/basic_function_call_reader/gcc/basic_function_call_reader-before-analysis.il.expected @@ -0,0 +1,339 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000352", condition()) + ) + ) + Block("1752:l00000352", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000360", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000379", condition()) + ) + ) + Block("1764:l00000379", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000360", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000036c", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002bd", condition()) + ) + ) + Block("1788:l000002bd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l0000055b", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001e7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000610", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003c9", condition()) + ) + ) + Block("1604:l000001fd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003c9", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003ab", condition()) + ) + ) + Block("1640:l000003ab", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003be", condition()) + ) + ) + Block("1660:l00000242", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003be", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1860:l00000332", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1852:l00000349", condition()) + ) + ) + Block("1860:l00000332", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + ), + jumps( + GoTo("1864:l0000033e", condition()) + ) + ) + Block("1852:l00000349", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + GoTo("1864:l0000033e", condition()) + ) + ) + Block("1864:l0000033e", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000038d", condition()) + ) + ) + Block("1700:l0000038d", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003a0", condition()) + ) + ) + Block("1720:l0000027e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003a0", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_function_call_reader/gcc_O2/basic_function_call_reader-before-analysis.il.expected b/src/test/correct/basic_function_call_reader/gcc_O2/basic_function_call_reader-before-analysis.il.expected new file mode 100644 index 000000000..33505dbdb --- /dev/null +++ b/src/test/correct/basic_function_call_reader/gcc_O2/basic_function_call_reader-before-analysis.il.expected @@ -0,0 +1,320 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f3", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000031c", condition()) + ) + ) + Block("1816:l0000031c", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000032a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000343", condition()) + ) + ) + Block("1828:l00000343", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000032a", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000336", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f3", condition()) + ) + ) + Block("1852:l000002f3", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l0000052d", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l0000021d", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005e3", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000233", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000393", condition()) + ) + ) + Block("1668:l00000233", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000393", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000375", condition()) + ) + ) + Block("1704:l00000375", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000388", condition()) + ) + ) + Block("1724:l00000278", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000388", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 20bv64)]), 32)) + ), + jumps( + GoTo("1556:l000001bc", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32), 0bv1))) + GoTo("1552:l00000398", condition()) + ) + ) + Block("1552:l00000398", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4bv64)]), 32)) + ), + jumps( + GoTo("1556:l000001bc", condition()) + ) + ) + Block("1556:l000001bc", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000357", condition()) + ) + ) + Block("1764:l00000357", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000036a", condition()) + ) + ) + Block("1784:l000002b4", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000036a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_function_call_reader/gcc_no_plt_no_pic/basic_function_call_reader-before-analysis.il.expected b/src/test/correct/basic_function_call_reader/gcc_no_plt_no_pic/basic_function_call_reader-before-analysis.il.expected new file mode 100644 index 000000000..e7fb5e2d4 --- /dev/null +++ b/src/test/correct/basic_function_call_reader/gcc_no_plt_no_pic/basic_function_call_reader-before-analysis.il.expected @@ -0,0 +1,339 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008c2", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000957", condition()) + ) + ) + Block("1752:l00000957", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000965", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000097e", condition()) + ) + ) + Block("1764:l0000097e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000965", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000971", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008c2", condition()) + ) + ) + Block("1788:l000008c2", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b60", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007ec", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000bf1", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000802", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000009ce", condition()) + ) + ) + Block("1604:l00000802", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000009ce", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000847", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009b0", condition()) + ) + ) + Block("1640:l000009b0", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000847", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009c3", condition()) + ) + ) + Block("1660:l00000847", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009c3", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1860:l00000937", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1852:l0000094e", condition()) + ) + ) + Block("1860:l00000937", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + ), + jumps( + GoTo("1864:l00000943", condition()) + ) + ) + Block("1852:l0000094e", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + GoTo("1864:l00000943", condition()) + ) + ) + Block("1864:l00000943", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000883", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000992", condition()) + ) + ) + Block("1700:l00000992", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000883", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009a5", condition()) + ) + ) + Block("1720:l00000883", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009a5", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_function_call_reader/gcc_pic/basic_function_call_reader-before-analysis.il.expected b/src/test/correct/basic_function_call_reader/gcc_pic/basic_function_call_reader-before-analysis.il.expected new file mode 100644 index 000000000..ad10d013d --- /dev/null +++ b/src/test/correct/basic_function_call_reader/gcc_pic/basic_function_call_reader-before-analysis.il.expected @@ -0,0 +1,339 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000354", condition()) + ) + ) + Block("1816:l00000354", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1840:l00000362", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000037b", condition()) + ) + ) + Block("1828:l0000037b", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000362", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000036e", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002bd", condition()) + ) + ) + Block("1852:l000002bd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1936:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1936:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l00000502", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001e7", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l0000059e", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1668:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003cb", condition()) + ) + ) + Block("1668:l000001fd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003cb", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003ad", condition()) + ) + ) + Block("1704:l000003ad", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) + ), + jumps( + GoTo("1724:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003c0", condition()) + ) + ) + Block("1724:l00000242", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003c0", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1924:l00000334", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1916:l0000034b", condition()) + ) + ) + Block("1924:l00000334", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + ), + jumps( + GoTo("1928:l00000340", condition()) + ) + ) + Block("1916:l0000034b", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + GoTo("1928:l00000340", condition()) + ) + ) + Block("1928:l00000340", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000038f", condition()) + ) + ) + Block("1764:l0000038f", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003a2", condition()) + ) + ) + Block("1784:l0000027e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003a2", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_read/clang/basic_lock_read-before-analysis.il.expected b/src/test/correct/basic_lock_read/clang/basic_lock_read-before-analysis.il.expected new file mode 100644 index 000000000..e4c47501d --- /dev/null +++ b/src/test/correct/basic_lock_read/clang/basic_lock_read-before-analysis.il.expected @@ -0,0 +1,364 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000375", condition()) + ) + ) + Block("1752:l00000375", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000383", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000039c", condition()) + ) + ) + Block("1764:l0000039c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000383", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000038f", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002c5", condition()) + ) + ) + Block("1788:l000002c5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1880:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1880:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000580", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001ef", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000636", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003ec", condition()) + ) + ) + Block("1604:l00000205", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003ec", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003ce", condition()) + ) + ) + Block("1640:l000003ce", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003e1", condition()) + ) + ) + Block("1660:l0000024a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003e1", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l0000032d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000330", condition()) + ) + ) + Block("?:l00000330", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000333", condition()) + ) + ) + Block("?:l0000032d", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000333", condition()) + ) + ) + Block("?:l00000333", + statements( + ), + jumps( + GoTo("1868:l0000033b", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1844:l00000352", condition()) + ) + ) + Block("1844:l00000352", + statements( + ), + jumps( + GoTo("1848:l00000353", condition()) + ) + ) + Block("1848:l00000353", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1868:l0000033b", condition()) + ) + ) + Block("1868:l0000033b", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003b0", condition()) + ) + ) + Block("1700:l000003b0", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003c3", condition()) + ) + ) + Block("1720:l00000286", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003c3", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_read/clang_O2/basic_lock_read-before-analysis.il.expected b/src/test/correct/basic_lock_read/clang_O2/basic_lock_read-before-analysis.il.expected new file mode 100644 index 000000000..f0d04b48f --- /dev/null +++ b/src/test/correct/basic_lock_read/clang_O2/basic_lock_read-before-analysis.il.expected @@ -0,0 +1,322 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000301", condition()) + ) + ) + Block("1752:l00000301", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000030f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000328", condition()) + ) + ) + Block("1764:l00000328", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000030f", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000031b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002a5", condition()) + ) + ) + Block("1788:l000002a5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1848:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000504", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001cf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005b2", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000378", condition()) + ) + ) + Block("1604:l000001e5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000378", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000035a", condition()) + ) + ) + Block("1640:l0000035a", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000036d", condition()) + ) + ) + Block("1660:l0000022a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000036d", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + ), + jumps( + GoTo("1832:l000002dc", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[32:0]), 0bv32), 0bv1))) + GoTo("1824:l000002f7", condition()) + ) + ) + Block("1832:l000002dc", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1824:l000002f7", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000033c", condition()) + ) + ) + Block("1700:l0000033c", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000034f", condition()) + ) + ) + Block("1720:l00000266", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000034f", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_read/clang_no_plt_no_pic/basic_lock_read-before-analysis.il.expected b/src/test/correct/basic_lock_read/clang_no_plt_no_pic/basic_lock_read-before-analysis.il.expected new file mode 100644 index 000000000..99ef4c9fc --- /dev/null +++ b/src/test/correct/basic_lock_read/clang_no_plt_no_pic/basic_lock_read-before-analysis.il.expected @@ -0,0 +1,364 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008f0", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000009a0", condition()) + ) + ) + Block("1752:l000009a0", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000009ae", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009c7", condition()) + ) + ) + Block("1764:l000009c7", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000009ae", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009ba", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008f0", condition()) + ) + ) + Block("1788:l000008f0", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1880:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1880:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000bab", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000081a", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c3e", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000830", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a17", condition()) + ) + ) + Block("1604:l00000830", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a17", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009f9", condition()) + ) + ) + Block("1640:l000009f9", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a0c", condition()) + ) + ) + Block("1660:l00000875", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a0c", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000958", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l0000095b", condition()) + ) + ) + Block("?:l0000095b", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l0000095e", condition()) + ) + ) + Block("?:l00000958", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l0000095e", condition()) + ) + ) + Block("?:l0000095e", + statements( + ), + jumps( + GoTo("1868:l00000966", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1844:l0000097d", condition()) + ) + ) + Block("1844:l0000097d", + statements( + ), + jumps( + GoTo("1848:l0000097e", condition()) + ) + ) + Block("1848:l0000097e", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1868:l00000966", condition()) + ) + ) + Block("1868:l00000966", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008b1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009db", condition()) + ) + ) + Block("1700:l000009db", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000008b1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009ee", condition()) + ) + ) + Block("1720:l000008b1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009ee", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_read/clang_pic/basic_lock_read-before-analysis.il.expected b/src/test/correct/basic_lock_read/clang_pic/basic_lock_read-before-analysis.il.expected new file mode 100644 index 000000000..d93af3faa --- /dev/null +++ b/src/test/correct/basic_lock_read/clang_pic/basic_lock_read-before-analysis.il.expected @@ -0,0 +1,366 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002cd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000038b", condition()) + ) + ) + Block("1816:l0000038b", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) + ), + jumps( + GoTo("1840:l00000399", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l000003b2", condition()) + ) + ) + Block("1828:l000003b2", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000399", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000003a5", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002cd", condition()) + ) + ) + Block("1852:l000002cd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1952:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1952:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l00000539", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001f7", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l000005d8", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l0000020d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000402", condition()) + ) + ) + Block("1668:l0000020d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000402", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003e4", condition()) + ) + ) + Block("1704:l000003e4", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) + ), + jumps( + GoTo("1724:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003f7", condition()) + ) + ) + Block("1724:l00000252", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003f7", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l0000033c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l0000033f", condition()) + ) + ) + Block("?:l0000033f", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000342", condition()) + ) + ) + Block("?:l0000033c", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000342", condition()) + ) + ) + Block("?:l00000342", + statements( + ), + jumps( + GoTo("1940:l0000034a", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1912:l00000361", condition()) + ) + ) + Block("1912:l00000361", + statements( + ), + jumps( + GoTo("1916:l00000362", condition()) + ) + ) + Block("1916:l00000362", + statements( + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4040bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1940:l0000034a", condition()) + ) + ) + Block("1940:l0000034a", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003c6", condition()) + ) + ) + Block("1764:l000003c6", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003d9", condition()) + ) + ) + Block("1784:l0000028e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003d9", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_read/gcc/basic_lock_read-before-analysis.il.expected b/src/test/correct/basic_lock_read/gcc/basic_lock_read-before-analysis.il.expected new file mode 100644 index 000000000..751904ef6 --- /dev/null +++ b/src/test/correct/basic_lock_read/gcc/basic_lock_read-before-analysis.il.expected @@ -0,0 +1,335 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000036a", condition()) + ) + ) + Block("1752:l0000036a", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000378", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000391", condition()) + ) + ) + Block("1764:l00000391", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000378", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000384", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002c5", condition()) + ) + ) + Block("1788:l000002c5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1880:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1880:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000575", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001ef", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000062c", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003e1", condition()) + ) + ) + Block("1604:l00000205", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003e1", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003c3", condition()) + ) + ) + Block("1640:l000003c3", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003d6", condition()) + ) + ) + Block("1660:l0000024a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003d6", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1868:l00000327", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1840:l0000033e", condition()) + ) + ) + Block("1840:l0000033e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1868:l00000327", condition()) + ) + ) + Block("1868:l00000327", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003a5", condition()) + ) + ) + Block("1700:l000003a5", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003b8", condition()) + ) + ) + Block("1720:l00000286", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003b8", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_read/gcc_O2/basic_lock_read-before-analysis.il.expected b/src/test/correct/basic_lock_read/gcc_O2/basic_lock_read-before-analysis.il.expected new file mode 100644 index 000000000..fa24d477f --- /dev/null +++ b/src/test/correct/basic_lock_read/gcc_O2/basic_lock_read-before-analysis.il.expected @@ -0,0 +1,321 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000320", condition()) + ) + ) + Block("1816:l00000320", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000032e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000347", condition()) + ) + ) + Block("1828:l00000347", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000032e", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000033a", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f7", condition()) + ) + ) + Block("1852:l000002f7", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l00000531", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000221", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005e7", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000237", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000397", condition()) + ) + ) + Block("1668:l00000237", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000397", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000027c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000379", condition()) + ) + ) + Block("1704:l00000379", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l0000027c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l0000038c", condition()) + ) + ) + Block("1724:l0000027c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l0000038c", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 20bv64)]), 32)) + ), + jumps( + GoTo("1556:l000001bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1552:l0000039c", condition()) + ) + ) + Block("1552:l0000039c", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 4bv64)] := 0bv32)) + ), + jumps( + GoTo("1556:l000001bd", condition()) + ) + ) + Block("1556:l000001bd", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002b8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000035b", condition()) + ) + ) + Block("1764:l0000035b", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002b8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000036e", condition()) + ) + ) + Block("1784:l000002b8", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000036e", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_read/gcc_no_plt_no_pic/basic_lock_read-before-analysis.il.expected b/src/test/correct/basic_lock_read/gcc_no_plt_no_pic/basic_lock_read-before-analysis.il.expected new file mode 100644 index 000000000..4ecd96e77 --- /dev/null +++ b/src/test/correct/basic_lock_read/gcc_no_plt_no_pic/basic_lock_read-before-analysis.il.expected @@ -0,0 +1,335 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008e6", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000098b", condition()) + ) + ) + Block("1752:l0000098b", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000999", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009b2", condition()) + ) + ) + Block("1764:l000009b2", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000999", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009a5", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008e6", condition()) + ) + ) + Block("1788:l000008e6", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1880:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1880:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b96", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000810", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c29", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000826", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a02", condition()) + ) + ) + Block("1604:l00000826", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a02", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000086b", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009e4", condition()) + ) + ) + Block("1640:l000009e4", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000086b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009f7", condition()) + ) + ) + Block("1660:l0000086b", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009f7", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1868:l00000948", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1840:l0000095f", condition()) + ) + ) + Block("1840:l0000095f", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1868:l00000948", condition()) + ) + ) + Block("1868:l00000948", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008a7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009c6", condition()) + ) + ) + Block("1700:l000009c6", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000008a7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009d9", condition()) + ) + ) + Block("1720:l000008a7", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009d9", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_read/gcc_pic/basic_lock_read-before-analysis.il.expected b/src/test/correct/basic_lock_read/gcc_pic/basic_lock_read-before-analysis.il.expected new file mode 100644 index 000000000..4af95e143 --- /dev/null +++ b/src/test/correct/basic_lock_read/gcc_pic/basic_lock_read-before-analysis.il.expected @@ -0,0 +1,335 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000036d", condition()) + ) + ) + Block("1816:l0000036d", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1840:l0000037b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000394", condition()) + ) + ) + Block("1828:l00000394", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000037b", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000387", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002c5", condition()) + ) + ) + Block("1852:l000002c5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1944:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l0000051b", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001ef", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l000005b9", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003e4", condition()) + ) + ) + Block("1668:l00000205", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003e4", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003c6", condition()) + ) + ) + Block("1704:l000003c6", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003d9", condition()) + ) + ) + Block("1724:l0000024a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003d9", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1932:l00000328", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1904:l0000033f", condition()) + ) + ) + Block("1904:l0000033f", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1932:l00000328", condition()) + ) + ) + Block("1932:l00000328", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003a8", condition()) + ) + ) + Block("1764:l000003a8", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003bb", condition()) + ) + ) + Block("1784:l00000286", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003bb", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_security_read/clang/basic_lock_security_read-before-analysis.il.expected b/src/test/correct/basic_lock_security_read/clang/basic_lock_security_read-before-analysis.il.expected new file mode 100644 index 000000000..c1ed30212 --- /dev/null +++ b/src/test/correct/basic_lock_security_read/clang/basic_lock_security_read-before-analysis.il.expected @@ -0,0 +1,363 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002c1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000036a", condition()) + ) + ) + Block("1752:l0000036a", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000378", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000391", condition()) + ) + ) + Block("1764:l00000391", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000378", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000384", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002c1", condition()) + ) + ) + Block("1788:l000002c1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000574", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001eb", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000629", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000201", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003e1", condition()) + ) + ) + Block("1604:l00000201", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003e1", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003c3", condition()) + ) + ) + Block("1640:l000003c3", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003d6", condition()) + ) + ) + Block("1660:l00000246", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003d6", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000329", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l0000032c", condition()) + ) + ) + Block("?:l0000032c", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l0000032f", condition()) + ) + ) + Block("?:l00000329", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l0000032f", condition()) + ) + ) + Block("?:l0000032f", + statements( + ), + jumps( + GoTo("1864:l00000337", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1844:l0000034e", condition()) + ) + ) + Block("1844:l0000034e", + statements( + ), + jumps( + GoTo("1848:l0000034f", condition()) + ) + ) + Block("1848:l0000034f", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1864:l00000337", condition()) + ) + ) + Block("1864:l00000337", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003a5", condition()) + ) + ) + Block("1700:l000003a5", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003b8", condition()) + ) + ) + Block("1720:l00000282", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003b8", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_security_read/clang_O2/basic_lock_security_read-before-analysis.il.expected b/src/test/correct/basic_lock_security_read/clang_O2/basic_lock_security_read-before-analysis.il.expected new file mode 100644 index 000000000..c2250813b --- /dev/null +++ b/src/test/correct/basic_lock_security_read/clang_O2/basic_lock_security_read-before-analysis.il.expected @@ -0,0 +1,334 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000030b", condition()) + ) + ) + Block("1752:l0000030b", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000319", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000332", condition()) + ) + ) + Block("1764:l00000332", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000319", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000325", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000029d", condition()) + ) + ) + Block("1788:l0000029d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1840:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l0000050c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005b7", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000382", condition()) + ) + ) + Block("1604:l000001dd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000382", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000364", condition()) + ) + ) + Block("1640:l00000364", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000377", condition()) + ) + ) + Block("1660:l00000222", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000377", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 56bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("?:l000002fa", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l000002fd", condition()) + ) + ) + Block("?:l000002fd", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000300", condition()) + ) + ) + Block("?:l000002fa", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(Extract(Register(R9, bv64)[32:0]), 32)) + ), + jumps( + GoTo("?:l00000300", condition()) + ) + ) + Block("?:l00000300", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000346", condition()) + ) + ) + Block("1700:l00000346", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000359", condition()) + ) + ) + Block("1720:l0000025e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000359", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_security_read/clang_no_plt_no_pic/basic_lock_security_read-before-analysis.il.expected b/src/test/correct/basic_lock_security_read/clang_no_plt_no_pic/basic_lock_security_read-before-analysis.il.expected new file mode 100644 index 000000000..fc7392c3a --- /dev/null +++ b/src/test/correct/basic_lock_security_read/clang_no_plt_no_pic/basic_lock_security_read-before-analysis.il.expected @@ -0,0 +1,363 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008df", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000988", condition()) + ) + ) + Block("1752:l00000988", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000996", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009af", condition()) + ) + ) + Block("1764:l000009af", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000996", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009a2", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008df", condition()) + ) + ) + Block("1788:l000008df", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b92", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000809", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c24", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000081f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000009ff", condition()) + ) + ) + Block("1604:l0000081f", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000009ff", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000864", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009e1", condition()) + ) + ) + Block("1640:l000009e1", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000864", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009f4", condition()) + ) + ) + Block("1660:l00000864", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009f4", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000947", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l0000094a", condition()) + ) + ) + Block("?:l0000094a", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l0000094d", condition()) + ) + ) + Block("?:l00000947", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l0000094d", condition()) + ) + ) + Block("?:l0000094d", + statements( + ), + jumps( + GoTo("1864:l00000955", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1844:l0000096c", condition()) + ) + ) + Block("1844:l0000096c", + statements( + ), + jumps( + GoTo("1848:l0000096d", condition()) + ) + ) + Block("1848:l0000096d", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1864:l00000955", condition()) + ) + ) + Block("1864:l00000955", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008a0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009c3", condition()) + ) + ) + Block("1700:l000009c3", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000008a0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009d6", condition()) + ) + ) + Block("1720:l000008a0", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009d6", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_security_read/clang_pic/basic_lock_security_read-before-analysis.il.expected b/src/test/correct/basic_lock_security_read/clang_pic/basic_lock_security_read-before-analysis.il.expected new file mode 100644 index 000000000..7ccc34122 --- /dev/null +++ b/src/test/correct/basic_lock_security_read/clang_pic/basic_lock_security_read-before-analysis.il.expected @@ -0,0 +1,365 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002c9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000380", condition()) + ) + ) + Block("1816:l00000380", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) + ), + jumps( + GoTo("1840:l0000038e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l000003a7", condition()) + ) + ) + Block("1828:l000003a7", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000038e", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000039a", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002c9", condition()) + ) + ) + Block("1852:l000002c9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1948:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1948:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l0000052e", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001f3", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l000005cc", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l00000209", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003f7", condition()) + ) + ) + Block("1668:l00000209", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003f7", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003d9", condition()) + ) + ) + Block("1704:l000003d9", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) + ), + jumps( + GoTo("1724:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003ec", condition()) + ) + ) + Block("1724:l0000024e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003ec", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000338", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l0000033b", condition()) + ) + ) + Block("?:l0000033b", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l0000033e", condition()) + ) + ) + Block("?:l00000338", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l0000033e", condition()) + ) + ) + Block("?:l0000033e", + statements( + ), + jumps( + GoTo("1936:l00000346", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1912:l0000035d", condition()) + ) + ) + Block("1912:l0000035d", + statements( + ), + jumps( + GoTo("1916:l0000035e", condition()) + ) + ) + Block("1916:l0000035e", + statements( + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4040bv64)])) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1936:l00000346", condition()) + ) + ) + Block("1936:l00000346", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003bb", condition()) + ) + ) + Block("1764:l000003bb", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003ce", condition()) + ) + ) + Block("1784:l0000028a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003ce", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_security_read/gcc/basic_lock_security_read-before-analysis.il.expected b/src/test/correct/basic_lock_security_read/gcc/basic_lock_security_read-before-analysis.il.expected new file mode 100644 index 000000000..2c38f67d3 --- /dev/null +++ b/src/test/correct/basic_lock_security_read/gcc/basic_lock_security_read-before-analysis.il.expected @@ -0,0 +1,332 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002b9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000034c", condition()) + ) + ) + Block("1752:l0000034c", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l0000035a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000373", condition()) + ) + ) + Block("1764:l00000373", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000035a", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000366", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002b9", condition()) + ) + ) + Block("1788:l000002b9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1868:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1868:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000554", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001e3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000608", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000001f9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003c3", condition()) + ) + ) + Block("1604:l000001f9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003c3", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003a5", condition()) + ) + ) + Block("1640:l000003a5", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003b8", condition()) + ) + ) + Block("1660:l0000023e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003b8", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1856:l0000031b", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1840:l00000332", condition()) + ) + ) + Block("1840:l00000332", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1856:l0000031b", condition()) + ) + ) + Block("1856:l0000031b", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000387", condition()) + ) + ) + Block("1700:l00000387", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000039a", condition()) + ) + ) + Block("1720:l0000027a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000039a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_security_read/gcc_O2/basic_lock_security_read-before-analysis.il.expected b/src/test/correct/basic_lock_security_read/gcc_O2/basic_lock_security_read-before-analysis.il.expected new file mode 100644 index 000000000..25a0e3431 --- /dev/null +++ b/src/test/correct/basic_lock_security_read/gcc_O2/basic_lock_security_read-before-analysis.il.expected @@ -0,0 +1,321 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000320", condition()) + ) + ) + Block("1816:l00000320", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000032e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000347", condition()) + ) + ) + Block("1828:l00000347", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000032e", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000033a", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f7", condition()) + ) + ) + Block("1852:l000002f7", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l00000531", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000221", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005e7", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000237", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000397", condition()) + ) + ) + Block("1668:l00000237", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000397", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000027c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000379", condition()) + ) + ) + Block("1704:l00000379", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l0000027c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l0000038c", condition()) + ) + ) + Block("1724:l0000027c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l0000038c", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 20bv64)]), 32)) + ), + jumps( + GoTo("1560:l000001c2", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R1, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1556:l0000039c", condition()) + ) + ) + Block("1556:l0000039c", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4bv64)]), 32)) + ), + jumps( + GoTo("1560:l000001c2", condition()) + ) + ) + Block("1560:l000001c2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002b8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000035b", condition()) + ) + ) + Block("1764:l0000035b", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002b8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000036e", condition()) + ) + ) + Block("1784:l000002b8", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000036e", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_security_read/gcc_no_plt_no_pic/basic_lock_security_read-before-analysis.il.expected b/src/test/correct/basic_lock_security_read/gcc_no_plt_no_pic/basic_lock_security_read-before-analysis.il.expected new file mode 100644 index 000000000..895c9ec9b --- /dev/null +++ b/src/test/correct/basic_lock_security_read/gcc_no_plt_no_pic/basic_lock_security_read-before-analysis.il.expected @@ -0,0 +1,332 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008b6", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000949", condition()) + ) + ) + Block("1752:l00000949", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000957", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000970", condition()) + ) + ) + Block("1764:l00000970", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000957", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000963", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008b6", condition()) + ) + ) + Block("1788:l000008b6", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1868:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1868:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b51", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007e0", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000be1", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000007f6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000009c0", condition()) + ) + ) + Block("1604:l000007f6", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000009c0", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000083b", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009a2", condition()) + ) + ) + Block("1640:l000009a2", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000083b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009b5", condition()) + ) + ) + Block("1660:l0000083b", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009b5", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1856:l00000918", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1840:l0000092f", condition()) + ) + ) + Block("1840:l0000092f", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1856:l00000918", condition()) + ) + ) + Block("1856:l00000918", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000877", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000984", condition()) + ) + ) + Block("1700:l00000984", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000877", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000997", condition()) + ) + ) + Block("1720:l00000877", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000997", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_security_read/gcc_pic/basic_lock_security_read-before-analysis.il.expected b/src/test/correct/basic_lock_security_read/gcc_pic/basic_lock_security_read-before-analysis.il.expected new file mode 100644 index 000000000..ea0f7d0bc --- /dev/null +++ b/src/test/correct/basic_lock_security_read/gcc_pic/basic_lock_security_read-before-analysis.il.expected @@ -0,0 +1,332 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002b9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000034e", condition()) + ) + ) + Block("1816:l0000034e", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1840:l0000035c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000375", condition()) + ) + ) + Block("1828:l00000375", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000035c", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000368", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002b9", condition()) + ) + ) + Block("1852:l000002b9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1932:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1932:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l000004fc", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001e3", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l00000597", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l000001f9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003c5", condition()) + ) + ) + Block("1668:l000001f9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003c5", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003a7", condition()) + ) + ) + Block("1704:l000003a7", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) + ), + jumps( + GoTo("1724:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003ba", condition()) + ) + ) + Block("1724:l0000023e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003ba", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1920:l0000031c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1904:l00000333", condition()) + ) + ) + Block("1904:l00000333", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1920:l0000031c", condition()) + ) + ) + Block("1920:l0000031c", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000389", condition()) + ) + ) + Block("1764:l00000389", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000039c", condition()) + ) + ) + Block("1784:l0000027a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000039c", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_security_write/clang/basic_lock_security_write-before-analysis.il.expected b/src/test/correct/basic_lock_security_write/clang/basic_lock_security_write-before-analysis.il.expected new file mode 100644 index 000000000..6c80d23e3 --- /dev/null +++ b/src/test/correct/basic_lock_security_write/clang/basic_lock_security_write-before-analysis.il.expected @@ -0,0 +1,313 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002b5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000330", condition()) + ) + ) + Block("1752:l00000330", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000033e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000357", condition()) + ) + ) + Block("1764:l00000357", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000033e", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000034a", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002b5", condition()) + ) + ) + Block("1788:l000002b5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1864:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1864:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000537", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001df", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005e8", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001f5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003a7", condition()) + ) + ) + Block("1604:l000001f5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003a7", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000023a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000389", condition()) + ) + ) + Block("1640:l00000389", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000023a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000039c", condition()) + ) + ) + Block("1660:l0000023a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000039c", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R9, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R10, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := 0bv32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000036b", condition()) + ) + ) + Block("1700:l0000036b", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000037e", condition()) + ) + ) + Block("1720:l00000276", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000037e", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_security_write/clang_O2/basic_lock_security_write-before-analysis.il.expected b/src/test/correct/basic_lock_security_write/clang_O2/basic_lock_security_write-before-analysis.il.expected new file mode 100644 index 000000000..f2519cbc4 --- /dev/null +++ b/src/test/correct/basic_lock_security_write/clang_O2/basic_lock_security_write-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002e4", condition()) + ) + ) + Block("1752:l000002e4", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002f2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000030b", condition()) + ) + ) + Block("1764:l0000030b", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002f2", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002fe", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000299", condition()) + ) + ) + Block("1788:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004e4", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000058e", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000035b", condition()) + ) + ) + Block("1604:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000035b", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000033d", condition()) + ) + ) + Block("1640:l0000033d", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000350", condition()) + ) + ) + Block("1660:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000350", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := 0bv32)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000031f", condition()) + ) + ) + Block("1700:l0000031f", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000332", condition()) + ) + ) + Block("1720:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000332", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_security_write/clang_no_plt_no_pic/basic_lock_security_write-before-analysis.il.expected b/src/test/correct/basic_lock_security_write/clang_no_plt_no_pic/basic_lock_security_write-before-analysis.il.expected new file mode 100644 index 000000000..a1fe1e437 --- /dev/null +++ b/src/test/correct/basic_lock_security_write/clang_no_plt_no_pic/basic_lock_security_write-before-analysis.il.expected @@ -0,0 +1,313 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000892", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000090d", condition()) + ) + ) + Block("1752:l0000090d", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000091b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000934", condition()) + ) + ) + Block("1764:l00000934", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000091b", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000927", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000892", condition()) + ) + ) + Block("1788:l00000892", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1864:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1864:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b14", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007bc", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000ba3", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000007d2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000984", condition()) + ) + ) + Block("1604:l000007d2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000984", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000817", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000966", condition()) + ) + ) + Block("1640:l00000966", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000817", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000979", condition()) + ) + ) + Block("1660:l00000817", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000979", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R9, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R10, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := 0bv32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000853", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000948", condition()) + ) + ) + Block("1700:l00000948", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000853", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000095b", condition()) + ) + ) + Block("1720:l00000853", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000095b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_security_write/clang_pic/basic_lock_security_write-before-analysis.il.expected b/src/test/correct/basic_lock_security_write/clang_pic/basic_lock_security_write-before-analysis.il.expected new file mode 100644 index 000000000..c1011d277 --- /dev/null +++ b/src/test/correct/basic_lock_security_write/clang_pic/basic_lock_security_write-before-analysis.il.expected @@ -0,0 +1,315 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000346", condition()) + ) + ) + Block("1816:l00000346", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) + ), + jumps( + GoTo("1840:l00000354", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000036d", condition()) + ) + ) + Block("1828:l0000036d", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000354", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000360", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002bd", condition()) + ) + ) + Block("1852:l000002bd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1936:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1936:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l000004f4", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001e7", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l0000058e", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003bd", condition()) + ) + ) + Block("1668:l000001fd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003bd", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000039f", condition()) + ) + ) + Block("1704:l0000039f", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) + ), + jumps( + GoTo("1724:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003b2", condition()) + ) + ) + Block("1724:l00000242", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003b2", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) + LocalAssign(Register(R9, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R9, bv64)[32:0]))) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4040bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R10, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := 0bv32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000381", condition()) + ) + ) + Block("1764:l00000381", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000394", condition()) + ) + ) + Block("1784:l0000027e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000394", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_security_write/gcc/basic_lock_security_write-before-analysis.il.expected b/src/test/correct/basic_lock_security_write/gcc/basic_lock_security_write-before-analysis.il.expected new file mode 100644 index 000000000..0318adc6a --- /dev/null +++ b/src/test/correct/basic_lock_security_write/gcc/basic_lock_security_write-before-analysis.il.expected @@ -0,0 +1,319 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002cd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000036a", condition()) + ) + ) + Block("1752:l0000036a", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000378", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000391", condition()) + ) + ) + Block("1764:l00000391", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000378", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000384", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002cd", condition()) + ) + ) + Block("1788:l000002cd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1888:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1888:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000577", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001f7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000062e", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l0000020d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003e1", condition()) + ) + ) + Block("1604:l0000020d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003e1", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003c3", condition()) + ) + ) + Block("1640:l000003c3", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003d6", condition()) + ) + ) + Block("1660:l00000252", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003d6", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003a5", condition()) + ) + ) + Block("1700:l000003a5", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003b8", condition()) + ) + ) + Block("1720:l0000028e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003b8", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_security_write/gcc_O2/basic_lock_security_write-before-analysis.il.expected b/src/test/correct/basic_lock_security_write/gcc_O2/basic_lock_security_write-before-analysis.il.expected new file mode 100644 index 000000000..3528f83ed --- /dev/null +++ b/src/test/correct/basic_lock_security_write/gcc_O2/basic_lock_security_write-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000321", condition()) + ) + ) + Block("1816:l00000321", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000032f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000348", condition()) + ) + ) + Block("1828:l00000348", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000032f", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000033b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f8", condition()) + ) + ) + Block("1852:l000002f8", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l0000052b", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000222", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005df", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000238", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000398", condition()) + ) + ) + Block("1668:l00000238", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000398", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000027d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000037a", condition()) + ) + ) + Block("1704:l0000037a", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l0000027d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l0000038d", condition()) + ) + ) + Block("1724:l0000027d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l0000038d", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R2, bv64), 4bv64)] := 0bv32)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002b9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000035c", condition()) + ) + ) + Block("1764:l0000035c", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002b9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000036f", condition()) + ) + ) + Block("1784:l000002b9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000036f", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_security_write/gcc_no_plt_no_pic/basic_lock_security_write-before-analysis.il.expected b/src/test/correct/basic_lock_security_write/gcc_no_plt_no_pic/basic_lock_security_write-before-analysis.il.expected new file mode 100644 index 000000000..10549f694 --- /dev/null +++ b/src/test/correct/basic_lock_security_write/gcc_no_plt_no_pic/basic_lock_security_write-before-analysis.il.expected @@ -0,0 +1,319 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008f0", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000098d", condition()) + ) + ) + Block("1752:l0000098d", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l0000099b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009b4", condition()) + ) + ) + Block("1764:l000009b4", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000099b", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009a7", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008f0", condition()) + ) + ) + Block("1788:l000008f0", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1888:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1888:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b9a", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000081a", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c2f", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000830", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a04", condition()) + ) + ) + Block("1604:l00000830", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a04", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009e6", condition()) + ) + ) + Block("1640:l000009e6", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009f9", condition()) + ) + ) + Block("1660:l00000875", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009f9", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008b1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009c8", condition()) + ) + ) + Block("1700:l000009c8", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000008b1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009db", condition()) + ) + ) + Block("1720:l000008b1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009db", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_security_write/gcc_pic/basic_lock_security_write-before-analysis.il.expected b/src/test/correct/basic_lock_security_write/gcc_pic/basic_lock_security_write-before-analysis.il.expected new file mode 100644 index 000000000..419de1839 --- /dev/null +++ b/src/test/correct/basic_lock_security_write/gcc_pic/basic_lock_security_write-before-analysis.il.expected @@ -0,0 +1,319 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002cd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000036e", condition()) + ) + ) + Block("1816:l0000036e", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1840:l0000037c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000395", condition()) + ) + ) + Block("1828:l00000395", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000037c", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000388", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002cd", condition()) + ) + ) + Block("1852:l000002cd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1952:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1952:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l0000051c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001f7", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l000005ba", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l0000020d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003e5", condition()) + ) + ) + Block("1668:l0000020d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003e5", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003c7", condition()) + ) + ) + Block("1704:l000003c7", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) + ), + jumps( + GoTo("1724:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003da", condition()) + ) + ) + Block("1724:l00000252", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003da", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003a9", condition()) + ) + ) + Block("1764:l000003a9", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003bc", condition()) + ) + ) + Block("1784:l0000028e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003bc", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_unlock/clang/basic_lock_unlock-before-analysis.il.expected b/src/test/correct/basic_lock_unlock/clang/basic_lock_unlock-before-analysis.il.expected new file mode 100644 index 000000000..065ae552d --- /dev/null +++ b/src/test/correct/basic_lock_unlock/clang/basic_lock_unlock-before-analysis.il.expected @@ -0,0 +1,307 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002ee", condition()) + ) + ) + Block("1752:l000002ee", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002fc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000315", condition()) + ) + ) + Block("1764:l00000315", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002fc", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000308", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000029d", condition()) + ) + ) + Block("1788:l0000029d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1840:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004ef", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000059a", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000365", condition()) + ) + ) + Block("1604:l000001dd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000365", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000347", condition()) + ) + ) + Block("1640:l00000347", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000035a", condition()) + ) + ) + Block("1660:l00000222", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000035a", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000329", condition()) + ) + ) + Block("1700:l00000329", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000033c", condition()) + ) + ) + Block("1720:l0000025e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000033c", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_unlock/clang_O2/basic_lock_unlock-before-analysis.il.expected b/src/test/correct/basic_lock_unlock/clang_O2/basic_lock_unlock-before-analysis.il.expected new file mode 100644 index 000000000..aead6bdad --- /dev/null +++ b/src/test/correct/basic_lock_unlock/clang_O2/basic_lock_unlock-before-analysis.il.expected @@ -0,0 +1,307 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002ee", condition()) + ) + ) + Block("1752:l000002ee", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002fc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000315", condition()) + ) + ) + Block("1764:l00000315", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002fc", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000308", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000029d", condition()) + ) + ) + Block("1788:l0000029d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1840:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004ef", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000059a", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000365", condition()) + ) + ) + Block("1604:l000001dd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000365", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000347", condition()) + ) + ) + Block("1640:l00000347", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000035a", condition()) + ) + ) + Block("1660:l00000222", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000035a", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 1bv64) + LocalAssign(Register(R10, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R10, bv64), 56bv64)] := 0bv32)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000329", condition()) + ) + ) + Block("1700:l00000329", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000033c", condition()) + ) + ) + Block("1720:l0000025e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000033c", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_unlock/clang_no_plt_no_pic/basic_lock_unlock-before-analysis.il.expected b/src/test/correct/basic_lock_unlock/clang_no_plt_no_pic/basic_lock_unlock-before-analysis.il.expected new file mode 100644 index 000000000..b22421bab --- /dev/null +++ b/src/test/correct/basic_lock_unlock/clang_no_plt_no_pic/basic_lock_unlock-before-analysis.il.expected @@ -0,0 +1,307 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000082c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000087d", condition()) + ) + ) + Block("1752:l0000087d", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000088b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000008a4", condition()) + ) + ) + Block("1764:l000008a4", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000088b", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000897", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000082c", condition()) + ) + ) + Block("1788:l0000082c", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1840:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000a7e", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000756", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000b07", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000076c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000008f4", condition()) + ) + ) + Block("1604:l0000076c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000008f4", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000007b1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000008d6", condition()) + ) + ) + Block("1640:l000008d6", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l000007b1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000008e9", condition()) + ) + ) + Block("1660:l000007b1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000008e9", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000007ed", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000008b8", condition()) + ) + ) + Block("1700:l000008b8", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000007ed", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000008cb", condition()) + ) + ) + Block("1720:l000007ed", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000008cb", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_unlock/clang_pic/basic_lock_unlock-before-analysis.il.expected b/src/test/correct/basic_lock_unlock/clang_pic/basic_lock_unlock-before-analysis.il.expected new file mode 100644 index 000000000..ea2c50526 --- /dev/null +++ b/src/test/correct/basic_lock_unlock/clang_pic/basic_lock_unlock-before-analysis.il.expected @@ -0,0 +1,309 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000304", condition()) + ) + ) + Block("1816:l00000304", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) + ), + jumps( + GoTo("1840:l00000312", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000032b", condition()) + ) + ) + Block("1828:l0000032b", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000312", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000031e", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002a5", condition()) + ) + ) + Block("1852:l000002a5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1912:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1912:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l000004b2", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001cf", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l00000546", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000037b", condition()) + ) + ) + Block("1668:l000001e5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000037b", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000035d", condition()) + ) + ) + Block("1704:l0000035d", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) + ), + jumps( + GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000370", condition()) + ) + ) + Block("1724:l0000022a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000370", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4040bv64)])) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := 0bv32)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000033f", condition()) + ) + ) + Block("1764:l0000033f", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000352", condition()) + ) + ) + Block("1784:l00000266", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000352", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_unlock/gcc/basic_lock_unlock-before-analysis.il.expected b/src/test/correct/basic_lock_unlock/gcc/basic_lock_unlock-before-analysis.il.expected new file mode 100644 index 000000000..ba7f92e56 --- /dev/null +++ b/src/test/correct/basic_lock_unlock/gcc/basic_lock_unlock-before-analysis.il.expected @@ -0,0 +1,309 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000302", condition()) + ) + ) + Block("1752:l00000302", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000310", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000329", condition()) + ) + ) + Block("1764:l00000329", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000310", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000031c", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002a5", condition()) + ) + ) + Block("1788:l000002a5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1848:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000505", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001cf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005b2", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000379", condition()) + ) + ) + Block("1604:l000001e5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000379", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000035b", condition()) + ) + ) + Block("1640:l0000035b", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000036e", condition()) + ) + ) + Block("1660:l0000022a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000036e", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000033d", condition()) + ) + ) + Block("1700:l0000033d", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000350", condition()) + ) + ) + Block("1720:l00000266", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000350", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_unlock/gcc_O2/basic_lock_unlock-before-analysis.il.expected b/src/test/correct/basic_lock_unlock/gcc_O2/basic_lock_unlock-before-analysis.il.expected new file mode 100644 index 000000000..972b56b5e --- /dev/null +++ b/src/test/correct/basic_lock_unlock/gcc_O2/basic_lock_unlock-before-analysis.il.expected @@ -0,0 +1,307 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002fc", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000325", condition()) + ) + ) + Block("1816:l00000325", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l00000333", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000034c", condition()) + ) + ) + Block("1828:l0000034c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000333", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000033f", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002fc", condition()) + ) + ) + Block("1852:l000002fc", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l0000052f", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000226", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005e3", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l0000023c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000039c", condition()) + ) + ) + Block("1668:l0000023c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000039c", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000281", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000037e", condition()) + ) + ) + Block("1704:l0000037e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000281", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000391", condition()) + ) + ) + Block("1724:l00000281", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000391", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) + LocalAssign(Register(R3, bv64) := 1bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R3, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R2, bv64), 4bv64)] := 0bv32)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000360", condition()) + ) + ) + Block("1764:l00000360", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000373", condition()) + ) + ) + Block("1784:l000002bd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000373", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_unlock/gcc_no_plt_no_pic/basic_lock_unlock-before-analysis.il.expected b/src/test/correct/basic_lock_unlock/gcc_no_plt_no_pic/basic_lock_unlock-before-analysis.il.expected new file mode 100644 index 000000000..e14ed6380 --- /dev/null +++ b/src/test/correct/basic_lock_unlock/gcc_no_plt_no_pic/basic_lock_unlock-before-analysis.il.expected @@ -0,0 +1,309 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000084c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000008a9", condition()) + ) + ) + Block("1752:l000008a9", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000008b7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000008d0", condition()) + ) + ) + Block("1764:l000008d0", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000008b7", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000008c3", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000084c", condition()) + ) + ) + Block("1788:l0000084c", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1848:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000aac", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000776", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000b37", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l0000078c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000920", condition()) + ) + ) + Block("1604:l0000078c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000920", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000007d1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000902", condition()) + ) + ) + Block("1640:l00000902", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l000007d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000915", condition()) + ) + ) + Block("1660:l000007d1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000915", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000080d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000008e4", condition()) + ) + ) + Block("1700:l000008e4", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000080d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000008f7", condition()) + ) + ) + Block("1720:l0000080d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000008f7", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_lock_unlock/gcc_pic/basic_lock_unlock-before-analysis.il.expected b/src/test/correct/basic_lock_unlock/gcc_pic/basic_lock_unlock-before-analysis.il.expected new file mode 100644 index 000000000..1964c6d9f --- /dev/null +++ b/src/test/correct/basic_lock_unlock/gcc_pic/basic_lock_unlock-before-analysis.il.expected @@ -0,0 +1,309 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000304", condition()) + ) + ) + Block("1816:l00000304", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1840:l00000312", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000032b", condition()) + ) + ) + Block("1828:l0000032b", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000312", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000031e", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002a5", condition()) + ) + ) + Block("1852:l000002a5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1912:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1912:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l000004b2", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001cf", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l00000546", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000037b", condition()) + ) + ) + Block("1668:l000001e5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000037b", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000035d", condition()) + ) + ) + Block("1704:l0000035d", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) + ), + jumps( + GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000370", condition()) + ) + ) + Block("1724:l0000022a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000370", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000033f", condition()) + ) + ) + Block("1764:l0000033f", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000352", condition()) + ) + ) + Block("1784:l00000266", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000352", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_loop_assign/clang/basic_loop_assign-before-analysis.il.expected b/src/test/correct/basic_loop_assign/clang/basic_loop_assign-before-analysis.il.expected new file mode 100644 index 000000000..1be12d1e2 --- /dev/null +++ b/src/test/correct/basic_loop_assign/clang/basic_loop_assign-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002da", condition()) + ) + ) + Block("1752:l000002da", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000301", condition()) + ) + ) + Block("1764:l00000301", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002e8", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002f4", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000295", condition()) + ) + ) + Block("1788:l00000295", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1832:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004d9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001bf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000582", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000351", condition()) + ) + ) + Block("1604:l000001d5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000351", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000333", condition()) + ) + ) + Block("1640:l00000333", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000346", condition()) + ) + ) + Block("1660:l0000021a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000346", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 20bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000315", condition()) + ) + ) + Block("1700:l00000315", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000328", condition()) + ) + ) + Block("1720:l00000256", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000328", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_loop_assign/clang_O2/basic_loop_assign-before-analysis.il.expected b/src/test/correct/basic_loop_assign/clang_O2/basic_loop_assign-before-analysis.il.expected new file mode 100644 index 000000000..c64bab336 --- /dev/null +++ b/src/test/correct/basic_loop_assign/clang_O2/basic_loop_assign-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002da", condition()) + ) + ) + Block("1752:l000002da", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000301", condition()) + ) + ) + Block("1764:l00000301", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002e8", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002f4", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000295", condition()) + ) + ) + Block("1788:l00000295", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1832:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004d9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001bf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000582", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000351", condition()) + ) + ) + Block("1604:l000001d5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000351", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000333", condition()) + ) + ) + Block("1640:l00000333", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000346", condition()) + ) + ) + Block("1660:l0000021a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000346", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 20bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000315", condition()) + ) + ) + Block("1700:l00000315", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000328", condition()) + ) + ) + Block("1720:l00000256", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000328", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_loop_assign/clang_no_plt_no_pic/basic_loop_assign-before-analysis.il.expected b/src/test/correct/basic_loop_assign/clang_no_plt_no_pic/basic_loop_assign-before-analysis.il.expected new file mode 100644 index 000000000..fe9a0e038 --- /dev/null +++ b/src/test/correct/basic_loop_assign/clang_no_plt_no_pic/basic_loop_assign-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000080c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000851", condition()) + ) + ) + Block("1752:l00000851", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000085f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000878", condition()) + ) + ) + Block("1764:l00000878", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000085f", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000086b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000080c", condition()) + ) + ) + Block("1788:l0000080c", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1832:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000a50", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000736", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000ad7", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000074c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000008c8", condition()) + ) + ) + Block("1604:l0000074c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000008c8", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000008aa", condition()) + ) + ) + Block("1640:l000008aa", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000008bd", condition()) + ) + ) + Block("1660:l00000791", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000008bd", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 20bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000088c", condition()) + ) + ) + Block("1700:l0000088c", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000089f", condition()) + ) + ) + Block("1720:l000007cd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000089f", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_loop_assign/clang_pic/basic_loop_assign-before-analysis.il.expected b/src/test/correct/basic_loop_assign/clang_pic/basic_loop_assign-before-analysis.il.expected new file mode 100644 index 000000000..4bf470b44 --- /dev/null +++ b/src/test/correct/basic_loop_assign/clang_pic/basic_loop_assign-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000002e5", condition()) + ) + ) + Block("1816:l000002e5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) + ), + jumps( + GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000030c", condition()) + ) + ) + Block("1828:l0000030c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l000002f3", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000002ff", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l00000299", condition()) + ) + ) + Block("1852:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1900:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l00000493", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l0000053d", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000035c", condition()) + ) + ) + Block("1668:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000035c", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000033e", condition()) + ) + ) + Block("1704:l0000033e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000351", condition()) + ) + ) + Block("1724:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000351", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4040bv64)])) + LocalAssign(Register(R8, bv64) := 20bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000320", condition()) + ) + ) + Block("1764:l00000320", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000333", condition()) + ) + ) + Block("1784:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000333", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_loop_assign/gcc/basic_loop_assign-before-analysis.il.expected b/src/test/correct/basic_loop_assign/gcc/basic_loop_assign-before-analysis.il.expected new file mode 100644 index 000000000..c7325f8c4 --- /dev/null +++ b/src/test/correct/basic_loop_assign/gcc/basic_loop_assign-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002e4", condition()) + ) + ) + Block("1752:l000002e4", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000002f2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000030b", condition()) + ) + ) + Block("1764:l0000030b", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002f2", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002fe", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000299", condition()) + ) + ) + Block("1788:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004e4", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000058e", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000035b", condition()) + ) + ) + Block("1604:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000035b", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000033d", condition()) + ) + ) + Block("1640:l0000033d", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000350", condition()) + ) + ) + Block("1660:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000350", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := 20bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000031f", condition()) + ) + ) + Block("1700:l0000031f", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000332", condition()) + ) + ) + Block("1720:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000332", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_loop_assign/gcc_O2/basic_loop_assign-before-analysis.il.expected b/src/test/correct/basic_loop_assign/gcc_O2/basic_loop_assign-before-analysis.il.expected new file mode 100644 index 000000000..877fefbbf --- /dev/null +++ b/src/test/correct/basic_loop_assign/gcc_O2/basic_loop_assign-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f3", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000031c", condition()) + ) + ) + Block("1816:l0000031c", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000032a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000343", condition()) + ) + ) + Block("1828:l00000343", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000032a", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000336", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f3", condition()) + ) + ) + Block("1852:l000002f3", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l00000526", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l0000021d", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005da", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000233", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000393", condition()) + ) + ) + Block("1668:l00000233", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000393", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000375", condition()) + ) + ) + Block("1704:l00000375", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000388", condition()) + ) + ) + Block("1724:l00000278", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000388", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R2, bv64) := 20bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R2, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000357", condition()) + ) + ) + Block("1764:l00000357", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000036a", condition()) + ) + ) + Block("1784:l000002b4", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000036a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_loop_assign/gcc_no_plt_no_pic/basic_loop_assign-before-analysis.il.expected b/src/test/correct/basic_loop_assign/gcc_no_plt_no_pic/basic_loop_assign-before-analysis.il.expected new file mode 100644 index 000000000..ba0c3bf8c --- /dev/null +++ b/src/test/correct/basic_loop_assign/gcc_no_plt_no_pic/basic_loop_assign-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000081c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000867", condition()) + ) + ) + Block("1752:l00000867", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000088e", condition()) + ) + ) + Block("1764:l0000088e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000875", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000881", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000081c", condition()) + ) + ) + Block("1788:l0000081c", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000a67", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000746", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000aef", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l0000075c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000008de", condition()) + ) + ) + Block("1604:l0000075c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000008de", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000008c0", condition()) + ) + ) + Block("1640:l000008c0", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000008d3", condition()) + ) + ) + Block("1660:l000007a1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000008d3", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := 20bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000008a2", condition()) + ) + ) + Block("1700:l000008a2", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000008b5", condition()) + ) + ) + Block("1720:l000007dd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000008b5", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_loop_assign/gcc_pic/basic_loop_assign-before-analysis.il.expected b/src/test/correct/basic_loop_assign/gcc_pic/basic_loop_assign-before-analysis.il.expected new file mode 100644 index 000000000..2ca11f727 --- /dev/null +++ b/src/test/correct/basic_loop_assign/gcc_pic/basic_loop_assign-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000002e5", condition()) + ) + ) + Block("1816:l000002e5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + ), + jumps( + GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000030c", condition()) + ) + ) + Block("1828:l0000030c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l000002f3", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000002ff", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l00000299", condition()) + ) + ) + Block("1852:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1900:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l00000493", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l0000053d", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000035c", condition()) + ) + ) + Block("1668:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000035c", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000033e", condition()) + ) + ) + Block("1704:l0000033e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000351", condition()) + ) + ) + Block("1724:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000351", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R1, bv64) := 20bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000320", condition()) + ) + ) + Block("1764:l00000320", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000333", condition()) + ) + ) + Block("1784:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000333", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_operation_evaluation/clang/basic_operation_evaluation-before-analysis.il.expected b/src/test/correct/basic_operation_evaluation/clang/basic_operation_evaluation-before-analysis.il.expected new file mode 100644 index 000000000..f3278a9be --- /dev/null +++ b/src/test/correct/basic_operation_evaluation/clang/basic_operation_evaluation-before-analysis.il.expected @@ -0,0 +1,359 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002f9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000414", condition()) + ) + ) + Block("1752:l00000414", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000422", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000043b", condition()) + ) + ) + Block("1764:l0000043b", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000422", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000042e", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002f9", condition()) + ) + ) + Block("1788:l000002f9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1932:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1932:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l0000062c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000223", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000006cc", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000239", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000048b", condition()) + ) + ) + Block("1604:l00000239", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000048b", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000046d", condition()) + ) + ) + Block("1640:l0000046d", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000480", condition()) + ) + ) + Block("1660:l0000027e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000480", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + LocalAssign(Register(R8, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) + LocalAssign(Register(R8, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("xor", Extract(Register(R8, bv64)[32:0]), Extract(Register(R9, bv64)[32:0])), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("or", Extract(Register(R8, bv64)[32:0]), Extract(Register(R9, bv64)[32:0])), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 30bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 17bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + ), + jumps( + GoTo("?:l000003c9", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R10, bv64)[32:0]), 0bv32), 0bv1))) + GoTo("?:l000003ce", condition()) + ) + ) + Block("?:l000003ce", + statements( + LocalAssign(Register(R9, bv64) := ZeroExtend(Extract(BinaryExpr("sdiv", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), SignExtend(Extract(Register(R10, bv64)[32:0]), 1))[32:0]), 32)) + ), + jumps( + GoTo("?:l000003d1", condition()) + ) + ) + Block("?:l000003c9", + statements( + LocalAssign(Register(R9, bv64) := 0bv64) + ), + jumps( + GoTo("?:l000003d1", condition()) + ) + ) + Block("?:l000003d1", + statements( + LocalAssign(Register(R9, bv64) := ZeroExtend(Extract(BinaryExpr("mul", ZeroExtend(Extract(Register(R9, bv64)[32:0]), 32), ZeroExtend(Extract(Register(R10, bv64)[32:0]), 32))[32:0]), 32)) + LocalAssign(LocalVar(#4, bv32) := UnaryExpr("not", Extract(Register(R9, bv64)[32:0]))) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), UnaryExpr("not", Extract(Register(R9, bv64)[32:0])))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), SignExtend(LocalVar(#4, bv32), 1)), 1bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), ZeroExtend(LocalVar(#4, bv32), 1)), 1bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000044f", condition()) + ) + ) + Block("1700:l0000044f", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000462", condition()) + ) + ) + Block("1720:l000002ba", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000462", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_operation_evaluation/clang_O2/basic_operation_evaluation-before-analysis.il.expected b/src/test/correct/basic_operation_evaluation/clang_O2/basic_operation_evaluation-before-analysis.il.expected new file mode 100644 index 000000000..3a5234909 --- /dev/null +++ b/src/test/correct/basic_operation_evaluation/clang_O2/basic_operation_evaluation-before-analysis.il.expected @@ -0,0 +1,302 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000289", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002bc", condition()) + ) + ) + Block("1752:l000002bc", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000002e3", condition()) + ) + ) + Block("1764:l000002e3", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002ca", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002d6", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000289", condition()) + ) + ) + Block("1788:l00000289", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1820:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1820:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004b8", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001b3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000053c", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001c9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000333", condition()) + ) + ) + Block("1604:l000001c9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000333", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000020e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000315", condition()) + ) + ) + Block("1640:l00000315", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000020e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000328", condition()) + ) + ) + Block("1660:l0000020e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000328", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000002f7", condition()) + ) + ) + Block("1700:l000002f7", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000030a", condition()) + ) + ) + Block("1720:l0000024a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000030a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_operation_evaluation/clang_no_plt_no_pic/basic_operation_evaluation-before-analysis.il.expected b/src/test/correct/basic_operation_evaluation/clang_no_plt_no_pic/basic_operation_evaluation-before-analysis.il.expected new file mode 100644 index 000000000..2c1c654a3 --- /dev/null +++ b/src/test/correct/basic_operation_evaluation/clang_no_plt_no_pic/basic_operation_evaluation-before-analysis.il.expected @@ -0,0 +1,359 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000009dc", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000af7", condition()) + ) + ) + Block("1752:l00000af7", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000b05", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000b1e", condition()) + ) + ) + Block("1764:l00000b1e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000b05", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000b11", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000009dc", condition()) + ) + ) + Block("1788:l000009dc", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1932:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1932:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000d0f", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000906", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000daf", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000091c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000b6e", condition()) + ) + ) + Block("1604:l0000091c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000b6e", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000961", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000b50", condition()) + ) + ) + Block("1640:l00000b50", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000961", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000b63", condition()) + ) + ) + Block("1660:l00000961", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000b63", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + LocalAssign(Register(R8, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) + LocalAssign(Register(R8, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("xor", Extract(Register(R8, bv64)[32:0]), Extract(Register(R9, bv64)[32:0])), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("or", Extract(Register(R8, bv64)[32:0]), Extract(Register(R9, bv64)[32:0])), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 30bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 17bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + ), + jumps( + GoTo("?:l00000aac", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R10, bv64)[32:0]), 0bv32), 0bv1))) + GoTo("?:l00000ab1", condition()) + ) + ) + Block("?:l00000ab1", + statements( + LocalAssign(Register(R9, bv64) := ZeroExtend(Extract(BinaryExpr("sdiv", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), SignExtend(Extract(Register(R10, bv64)[32:0]), 1))[32:0]), 32)) + ), + jumps( + GoTo("?:l00000ab4", condition()) + ) + ) + Block("?:l00000aac", + statements( + LocalAssign(Register(R9, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000ab4", condition()) + ) + ) + Block("?:l00000ab4", + statements( + LocalAssign(Register(R9, bv64) := ZeroExtend(Extract(BinaryExpr("mul", ZeroExtend(Extract(Register(R9, bv64)[32:0]), 32), ZeroExtend(Extract(Register(R10, bv64)[32:0]), 32))[32:0]), 32)) + LocalAssign(LocalVar(#4, bv32) := UnaryExpr("not", Extract(Register(R9, bv64)[32:0]))) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), UnaryExpr("not", Extract(Register(R9, bv64)[32:0])))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), SignExtend(LocalVar(#4, bv32), 1)), 1bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), ZeroExtend(LocalVar(#4, bv32), 1)), 1bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000099d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000b32", condition()) + ) + ) + Block("1700:l00000b32", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000099d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000b45", condition()) + ) + ) + Block("1720:l0000099d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000b45", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_operation_evaluation/clang_pic/basic_operation_evaluation-before-analysis.il.expected b/src/test/correct/basic_operation_evaluation/clang_pic/basic_operation_evaluation-before-analysis.il.expected new file mode 100644 index 000000000..2c1c654a3 --- /dev/null +++ b/src/test/correct/basic_operation_evaluation/clang_pic/basic_operation_evaluation-before-analysis.il.expected @@ -0,0 +1,359 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000009dc", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000af7", condition()) + ) + ) + Block("1752:l00000af7", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000b05", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000b1e", condition()) + ) + ) + Block("1764:l00000b1e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000b05", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000b11", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000009dc", condition()) + ) + ) + Block("1788:l000009dc", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1932:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1932:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000d0f", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000906", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000daf", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000091c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000b6e", condition()) + ) + ) + Block("1604:l0000091c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000b6e", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000961", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000b50", condition()) + ) + ) + Block("1640:l00000b50", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000961", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000b63", condition()) + ) + ) + Block("1660:l00000961", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000b63", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + LocalAssign(Register(R8, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) + LocalAssign(Register(R8, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("xor", Extract(Register(R8, bv64)[32:0]), Extract(Register(R9, bv64)[32:0])), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("or", Extract(Register(R8, bv64)[32:0]), Extract(Register(R9, bv64)[32:0])), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 30bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 17bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + ), + jumps( + GoTo("?:l00000aac", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R10, bv64)[32:0]), 0bv32), 0bv1))) + GoTo("?:l00000ab1", condition()) + ) + ) + Block("?:l00000ab1", + statements( + LocalAssign(Register(R9, bv64) := ZeroExtend(Extract(BinaryExpr("sdiv", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), SignExtend(Extract(Register(R10, bv64)[32:0]), 1))[32:0]), 32)) + ), + jumps( + GoTo("?:l00000ab4", condition()) + ) + ) + Block("?:l00000aac", + statements( + LocalAssign(Register(R9, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000ab4", condition()) + ) + ) + Block("?:l00000ab4", + statements( + LocalAssign(Register(R9, bv64) := ZeroExtend(Extract(BinaryExpr("mul", ZeroExtend(Extract(Register(R9, bv64)[32:0]), 32), ZeroExtend(Extract(Register(R10, bv64)[32:0]), 32))[32:0]), 32)) + LocalAssign(LocalVar(#4, bv32) := UnaryExpr("not", Extract(Register(R9, bv64)[32:0]))) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), UnaryExpr("not", Extract(Register(R9, bv64)[32:0])))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), SignExtend(LocalVar(#4, bv32), 1)), 1bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), ZeroExtend(LocalVar(#4, bv32), 1)), 1bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000099d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000b32", condition()) + ) + ) + Block("1700:l00000b32", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000099d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000b45", condition()) + ) + ) + Block("1720:l0000099d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000b45", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_operation_evaluation/gcc/basic_operation_evaluation-before-analysis.il.expected b/src/test/correct/basic_operation_evaluation/gcc/basic_operation_evaluation-before-analysis.il.expected new file mode 100644 index 000000000..5fa552e4d --- /dev/null +++ b/src/test/correct/basic_operation_evaluation/gcc/basic_operation_evaluation-before-analysis.il.expected @@ -0,0 +1,352 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002f5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000003ee", condition()) + ) + ) + Block("1752:l000003ee", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000003fc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000415", condition()) + ) + ) + Block("1764:l00000415", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000003fc", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000408", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002f5", condition()) + ) + ) + Block("1788:l000002f5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1928:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1928:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000605", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000021f", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000006a4", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000235", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000465", condition()) + ) + ) + Block("1604:l00000235", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000465", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000447", condition()) + ) + ) + Block("1640:l00000447", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000045a", condition()) + ) + ) + Block("1660:l0000027a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000045a", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R1, bv64))) + LocalAssign(Register(R0, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("xor", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("or", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 30bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 17bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) + ), + jumps( + GoTo("?:l000003b3", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R1, bv64)[32:0]), 0bv32), 0bv1))) + GoTo("?:l000003b8", condition()) + ) + ) + Block("?:l000003b8", + statements( + LocalAssign(Register(R2, bv64) := ZeroExtend(Extract(BinaryExpr("sdiv", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), SignExtend(Extract(Register(R1, bv64)[32:0]), 1))[32:0]), 32)) + ), + jumps( + GoTo("?:l000003bb", condition()) + ) + ) + Block("?:l000003b3", + statements( + LocalAssign(Register(R2, bv64) := 0bv64) + ), + jumps( + GoTo("?:l000003bb", condition()) + ) + ) + Block("?:l000003bb", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(BinaryExpr("mul", ZeroExtend(Extract(Register(R2, bv64)[32:0]), 32), ZeroExtend(Extract(Register(R1, bv64)[32:0]), 32))[32:0]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), UnaryExpr("not", Extract(Register(R1, bv64)[32:0]))), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000002b6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000429", condition()) + ) + ) + Block("1700:l00000429", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000002b6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000043c", condition()) + ) + ) + Block("1720:l000002b6", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000043c", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_operation_evaluation/gcc_O2/basic_operation_evaluation-before-analysis.il.expected b/src/test/correct/basic_operation_evaluation/gcc_O2/basic_operation_evaluation-before-analysis.il.expected new file mode 100644 index 000000000..ce866657b --- /dev/null +++ b/src/test/correct/basic_operation_evaluation/gcc_O2/basic_operation_evaluation-before-analysis.il.expected @@ -0,0 +1,302 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002e7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000310", condition()) + ) + ) + Block("1816:l00000310", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000031e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000337", condition()) + ) + ) + Block("1828:l00000337", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000031e", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000032a", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002e7", condition()) + ) + ) + Block("1852:l000002e7", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l0000051a", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000211", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005ac", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000227", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000387", condition()) + ) + ) + Block("1668:l00000227", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000387", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000026c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000369", condition()) + ) + ) + Block("1704:l00000369", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l0000026c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l0000037c", condition()) + ) + ) + Block("1724:l0000026c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l0000037c", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002a8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000034b", condition()) + ) + ) + Block("1764:l0000034b", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002a8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000035e", condition()) + ) + ) + Block("1784:l000002a8", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000035e", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_operation_evaluation/gcc_no_plt_no_pic/basic_operation_evaluation-before-analysis.il.expected b/src/test/correct/basic_operation_evaluation/gcc_no_plt_no_pic/basic_operation_evaluation-before-analysis.il.expected new file mode 100644 index 000000000..547946740 --- /dev/null +++ b/src/test/correct/basic_operation_evaluation/gcc_no_plt_no_pic/basic_operation_evaluation-before-analysis.il.expected @@ -0,0 +1,352 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000009b0", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000aa9", condition()) + ) + ) + Block("1752:l00000aa9", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000ab7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000ad0", condition()) + ) + ) + Block("1764:l00000ad0", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000ab7", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000ac3", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000009b0", condition()) + ) + ) + Block("1788:l000009b0", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1928:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1928:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000cc0", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000008da", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000d5f", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000008f0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000b20", condition()) + ) + ) + Block("1604:l000008f0", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000b20", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000935", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000b02", condition()) + ) + ) + Block("1640:l00000b02", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000935", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000b15", condition()) + ) + ) + Block("1660:l00000935", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000b15", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R1, bv64))) + LocalAssign(Register(R0, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("xor", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("or", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 30bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 17bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) + ), + jumps( + GoTo("?:l00000a6e", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R1, bv64)[32:0]), 0bv32), 0bv1))) + GoTo("?:l00000a73", condition()) + ) + ) + Block("?:l00000a73", + statements( + LocalAssign(Register(R2, bv64) := ZeroExtend(Extract(BinaryExpr("sdiv", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), SignExtend(Extract(Register(R1, bv64)[32:0]), 1))[32:0]), 32)) + ), + jumps( + GoTo("?:l00000a76", condition()) + ) + ) + Block("?:l00000a6e", + statements( + LocalAssign(Register(R2, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000a76", condition()) + ) + ) + Block("?:l00000a76", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(BinaryExpr("mul", ZeroExtend(Extract(Register(R2, bv64)[32:0]), 32), ZeroExtend(Extract(Register(R1, bv64)[32:0]), 32))[32:0]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), UnaryExpr("not", Extract(Register(R1, bv64)[32:0]))), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000971", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000ae4", condition()) + ) + ) + Block("1700:l00000ae4", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000971", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000af7", condition()) + ) + ) + Block("1720:l00000971", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000af7", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_operation_evaluation/gcc_pic/basic_operation_evaluation-before-analysis.il.expected b/src/test/correct/basic_operation_evaluation/gcc_pic/basic_operation_evaluation-before-analysis.il.expected new file mode 100644 index 000000000..547946740 --- /dev/null +++ b/src/test/correct/basic_operation_evaluation/gcc_pic/basic_operation_evaluation-before-analysis.il.expected @@ -0,0 +1,352 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000009b0", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000aa9", condition()) + ) + ) + Block("1752:l00000aa9", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000ab7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000ad0", condition()) + ) + ) + Block("1764:l00000ad0", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000ab7", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000ac3", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000009b0", condition()) + ) + ) + Block("1788:l000009b0", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1928:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1928:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000cc0", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000008da", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000d5f", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000008f0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000b20", condition()) + ) + ) + Block("1604:l000008f0", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000b20", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000935", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000b02", condition()) + ) + ) + Block("1640:l00000b02", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000935", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000b15", condition()) + ) + ) + Block("1660:l00000935", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000b15", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R1, bv64))) + LocalAssign(Register(R0, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("xor", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("or", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 30bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 17bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) + ), + jumps( + GoTo("?:l00000a6e", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R1, bv64)[32:0]), 0bv32), 0bv1))) + GoTo("?:l00000a73", condition()) + ) + ) + Block("?:l00000a73", + statements( + LocalAssign(Register(R2, bv64) := ZeroExtend(Extract(BinaryExpr("sdiv", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), SignExtend(Extract(Register(R1, bv64)[32:0]), 1))[32:0]), 32)) + ), + jumps( + GoTo("?:l00000a76", condition()) + ) + ) + Block("?:l00000a6e", + statements( + LocalAssign(Register(R2, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000a76", condition()) + ) + ) + Block("?:l00000a76", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(BinaryExpr("mul", ZeroExtend(Extract(Register(R2, bv64)[32:0]), 32), ZeroExtend(Extract(Register(R1, bv64)[32:0]), 32))[32:0]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), UnaryExpr("not", Extract(Register(R1, bv64)[32:0]))), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000971", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000ae4", condition()) + ) + ) + Block("1700:l00000ae4", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000971", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000af7", condition()) + ) + ) + Block("1720:l00000971", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000af7", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_sec_policy_read/clang/basic_sec_policy_read-before-analysis.il.expected b/src/test/correct/basic_sec_policy_read/clang/basic_sec_policy_read-before-analysis.il.expected new file mode 100644 index 000000000..fa16198d3 --- /dev/null +++ b/src/test/correct/basic_sec_policy_read/clang/basic_sec_policy_read-before-analysis.il.expected @@ -0,0 +1,363 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002c1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000036a", condition()) + ) + ) + Block("1752:l0000036a", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000378", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000391", condition()) + ) + ) + Block("1764:l00000391", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000378", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000384", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002c1", condition()) + ) + ) + Block("1788:l000002c1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000574", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001eb", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000629", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000201", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003e1", condition()) + ) + ) + Block("1604:l00000201", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003e1", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003c3", condition()) + ) + ) + Block("1640:l000003c3", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003d6", condition()) + ) + ) + Block("1660:l00000246", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003d6", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000336", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("?:l00000339", condition()) + ) + ) + Block("?:l00000339", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l0000033c", condition()) + ) + ) + Block("?:l00000336", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l0000033c", condition()) + ) + ) + Block("?:l0000033c", + statements( + ), + jumps( + GoTo("1864:l00000344", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1852:l0000035b", condition()) + ) + ) + Block("1852:l0000035b", + statements( + ), + jumps( + GoTo("1856:l0000035c", condition()) + ) + ) + Block("1856:l0000035c", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) + ), + jumps( + GoTo("1864:l00000344", condition()) + ) + ) + Block("1864:l00000344", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003a5", condition()) + ) + ) + Block("1700:l000003a5", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003b8", condition()) + ) + ) + Block("1720:l00000282", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003b8", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_sec_policy_read/clang_O2/basic_sec_policy_read-before-analysis.il.expected b/src/test/correct/basic_sec_policy_read/clang_O2/basic_sec_policy_read-before-analysis.il.expected new file mode 100644 index 000000000..47b8b7841 --- /dev/null +++ b/src/test/correct/basic_sec_policy_read/clang_O2/basic_sec_policy_read-before-analysis.il.expected @@ -0,0 +1,334 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000030b", condition()) + ) + ) + Block("1752:l0000030b", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000319", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000332", condition()) + ) + ) + Block("1764:l00000332", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000319", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000325", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000029d", condition()) + ) + ) + Block("1788:l0000029d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1840:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l0000050c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005b7", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000382", condition()) + ) + ) + Block("1604:l000001dd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000382", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000364", condition()) + ) + ) + Block("1640:l00000364", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000377", condition()) + ) + ) + Block("1660:l00000222", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000377", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("?:l000002fa", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l000002fd", condition()) + ) + ) + Block("?:l000002fd", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000300", condition()) + ) + ) + Block("?:l000002fa", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(Extract(Register(R9, bv64)[32:0]), 32)) + ), + jumps( + GoTo("?:l00000300", condition()) + ) + ) + Block("?:l00000300", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000346", condition()) + ) + ) + Block("1700:l00000346", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000359", condition()) + ) + ) + Block("1720:l0000025e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000359", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_sec_policy_read/clang_no_plt_no_pic/basic_sec_policy_read-before-analysis.il.expected b/src/test/correct/basic_sec_policy_read/clang_no_plt_no_pic/basic_sec_policy_read-before-analysis.il.expected new file mode 100644 index 000000000..b042bb2b8 --- /dev/null +++ b/src/test/correct/basic_sec_policy_read/clang_no_plt_no_pic/basic_sec_policy_read-before-analysis.il.expected @@ -0,0 +1,363 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008df", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000988", condition()) + ) + ) + Block("1752:l00000988", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000996", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009af", condition()) + ) + ) + Block("1764:l000009af", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000996", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009a2", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008df", condition()) + ) + ) + Block("1788:l000008df", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b92", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000809", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c24", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000081f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000009ff", condition()) + ) + ) + Block("1604:l0000081f", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000009ff", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000864", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009e1", condition()) + ) + ) + Block("1640:l000009e1", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000864", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009f4", condition()) + ) + ) + Block("1660:l00000864", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009f4", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000954", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("?:l00000957", condition()) + ) + ) + Block("?:l00000957", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l0000095a", condition()) + ) + ) + Block("?:l00000954", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l0000095a", condition()) + ) + ) + Block("?:l0000095a", + statements( + ), + jumps( + GoTo("1864:l00000962", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1852:l00000979", condition()) + ) + ) + Block("1852:l00000979", + statements( + ), + jumps( + GoTo("1856:l0000097a", condition()) + ) + ) + Block("1856:l0000097a", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) + ), + jumps( + GoTo("1864:l00000962", condition()) + ) + ) + Block("1864:l00000962", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008a0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009c3", condition()) + ) + ) + Block("1700:l000009c3", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000008a0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009d6", condition()) + ) + ) + Block("1720:l000008a0", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009d6", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_sec_policy_read/clang_pic/basic_sec_policy_read-before-analysis.il.expected b/src/test/correct/basic_sec_policy_read/clang_pic/basic_sec_policy_read-before-analysis.il.expected new file mode 100644 index 000000000..1727534b5 --- /dev/null +++ b/src/test/correct/basic_sec_policy_read/clang_pic/basic_sec_policy_read-before-analysis.il.expected @@ -0,0 +1,365 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002c9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000380", condition()) + ) + ) + Block("1816:l00000380", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) + ), + jumps( + GoTo("1840:l0000038e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l000003a7", condition()) + ) + ) + Block("1828:l000003a7", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000038e", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000039a", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002c9", condition()) + ) + ) + Block("1852:l000002c9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1948:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1948:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l0000052e", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001f3", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l000005cc", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l00000209", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003f7", condition()) + ) + ) + Block("1668:l00000209", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003f7", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003d9", condition()) + ) + ) + Block("1704:l000003d9", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) + ), + jumps( + GoTo("1724:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003ec", condition()) + ) + ) + Block("1724:l0000024e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003ec", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4040bv64)])) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l0000034c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("?:l0000034f", condition()) + ) + ) + Block("?:l0000034f", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000352", condition()) + ) + ) + Block("?:l0000034c", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000352", condition()) + ) + ) + Block("?:l00000352", + statements( + ), + jumps( + GoTo("1936:l0000035a", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1924:l00000371", condition()) + ) + ) + Block("1924:l00000371", + statements( + ), + jumps( + GoTo("1928:l00000372", condition()) + ) + ) + Block("1928:l00000372", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) + ), + jumps( + GoTo("1936:l0000035a", condition()) + ) + ) + Block("1936:l0000035a", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003bb", condition()) + ) + ) + Block("1764:l000003bb", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003ce", condition()) + ) + ) + Block("1784:l0000028a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003ce", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_sec_policy_read/gcc/basic_sec_policy_read-before-analysis.il.expected b/src/test/correct/basic_sec_policy_read/gcc/basic_sec_policy_read-before-analysis.il.expected new file mode 100644 index 000000000..d41a4e91a --- /dev/null +++ b/src/test/correct/basic_sec_policy_read/gcc/basic_sec_policy_read-before-analysis.il.expected @@ -0,0 +1,332 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002b9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000034c", condition()) + ) + ) + Block("1752:l0000034c", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l0000035a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000373", condition()) + ) + ) + Block("1764:l00000373", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000035a", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000366", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002b9", condition()) + ) + ) + Block("1788:l000002b9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1868:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1868:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000554", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001e3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000608", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000001f9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003c3", condition()) + ) + ) + Block("1604:l000001f9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003c3", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003a5", condition()) + ) + ) + Block("1640:l000003a5", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003b8", condition()) + ) + ) + Block("1660:l0000023e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003b8", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1856:l0000032e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1852:l00000345", condition()) + ) + ) + Block("1852:l00000345", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + ), + jumps( + GoTo("1856:l0000032e", condition()) + ) + ) + Block("1856:l0000032e", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000387", condition()) + ) + ) + Block("1700:l00000387", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000039a", condition()) + ) + ) + Block("1720:l0000027a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000039a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_sec_policy_read/gcc_O2/basic_sec_policy_read-before-analysis.il.expected b/src/test/correct/basic_sec_policy_read/gcc_O2/basic_sec_policy_read-before-analysis.il.expected new file mode 100644 index 000000000..25a0e3431 --- /dev/null +++ b/src/test/correct/basic_sec_policy_read/gcc_O2/basic_sec_policy_read-before-analysis.il.expected @@ -0,0 +1,321 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000320", condition()) + ) + ) + Block("1816:l00000320", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000032e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000347", condition()) + ) + ) + Block("1828:l00000347", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000032e", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000033a", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f7", condition()) + ) + ) + Block("1852:l000002f7", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l00000531", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000221", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005e7", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000237", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000397", condition()) + ) + ) + Block("1668:l00000237", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000397", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000027c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000379", condition()) + ) + ) + Block("1704:l00000379", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l0000027c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l0000038c", condition()) + ) + ) + Block("1724:l0000027c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l0000038c", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 20bv64)]), 32)) + ), + jumps( + GoTo("1560:l000001c2", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R1, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1556:l0000039c", condition()) + ) + ) + Block("1556:l0000039c", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4bv64)]), 32)) + ), + jumps( + GoTo("1560:l000001c2", condition()) + ) + ) + Block("1560:l000001c2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002b8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000035b", condition()) + ) + ) + Block("1764:l0000035b", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002b8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000036e", condition()) + ) + ) + Block("1784:l000002b8", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000036e", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_sec_policy_read/gcc_no_plt_no_pic/basic_sec_policy_read-before-analysis.il.expected b/src/test/correct/basic_sec_policy_read/gcc_no_plt_no_pic/basic_sec_policy_read-before-analysis.il.expected new file mode 100644 index 000000000..0e5be8b71 --- /dev/null +++ b/src/test/correct/basic_sec_policy_read/gcc_no_plt_no_pic/basic_sec_policy_read-before-analysis.il.expected @@ -0,0 +1,332 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008b6", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000949", condition()) + ) + ) + Block("1752:l00000949", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000957", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000970", condition()) + ) + ) + Block("1764:l00000970", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000957", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000963", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008b6", condition()) + ) + ) + Block("1788:l000008b6", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1868:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1868:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b51", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007e0", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000be1", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000007f6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000009c0", condition()) + ) + ) + Block("1604:l000007f6", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000009c0", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000083b", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009a2", condition()) + ) + ) + Block("1640:l000009a2", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000083b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009b5", condition()) + ) + ) + Block("1660:l0000083b", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009b5", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1856:l0000092b", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1852:l00000942", condition()) + ) + ) + Block("1852:l00000942", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + ), + jumps( + GoTo("1856:l0000092b", condition()) + ) + ) + Block("1856:l0000092b", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000877", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000984", condition()) + ) + ) + Block("1700:l00000984", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000877", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000997", condition()) + ) + ) + Block("1720:l00000877", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000997", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_sec_policy_read/gcc_pic/basic_sec_policy_read-before-analysis.il.expected b/src/test/correct/basic_sec_policy_read/gcc_pic/basic_sec_policy_read-before-analysis.il.expected new file mode 100644 index 000000000..3f606f52b --- /dev/null +++ b/src/test/correct/basic_sec_policy_read/gcc_pic/basic_sec_policy_read-before-analysis.il.expected @@ -0,0 +1,332 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002b9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000034e", condition()) + ) + ) + Block("1816:l0000034e", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1840:l0000035c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000375", condition()) + ) + ) + Block("1828:l00000375", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000035c", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000368", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002b9", condition()) + ) + ) + Block("1852:l000002b9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1932:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1932:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l000004fc", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001e3", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l00000597", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l000001f9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003c5", condition()) + ) + ) + Block("1668:l000001f9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003c5", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003a7", condition()) + ) + ) + Block("1704:l000003a7", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) + ), + jumps( + GoTo("1724:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003ba", condition()) + ) + ) + Block("1724:l0000023e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003ba", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1920:l00000330", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1916:l00000347", condition()) + ) + ) + Block("1916:l00000347", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + ), + jumps( + GoTo("1920:l00000330", condition()) + ) + ) + Block("1920:l00000330", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000389", condition()) + ) + ) + Block("1764:l00000389", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000039c", condition()) + ) + ) + Block("1784:l0000027a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000039c", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_sec_policy_write/clang/basic_sec_policy_write-before-analysis.il.expected b/src/test/correct/basic_sec_policy_write/clang/basic_sec_policy_write-before-analysis.il.expected new file mode 100644 index 000000000..dfefc882f --- /dev/null +++ b/src/test/correct/basic_sec_policy_write/clang/basic_sec_policy_write-before-analysis.il.expected @@ -0,0 +1,314 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002b9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000033a", condition()) + ) + ) + Block("1752:l0000033a", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000348", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000361", condition()) + ) + ) + Block("1764:l00000361", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000348", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000354", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002b9", condition()) + ) + ) + Block("1788:l000002b9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1868:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1868:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000542", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001e3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005f4", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001f9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003b1", condition()) + ) + ) + Block("1604:l000001f9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003b1", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000393", condition()) + ) + ) + Block("1640:l00000393", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003a6", condition()) + ) + ) + Block("1660:l0000023e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003a6", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := Extract(Register(R10, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000375", condition()) + ) + ) + Block("1700:l00000375", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000388", condition()) + ) + ) + Block("1720:l0000027a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000388", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_sec_policy_write/clang_O2/basic_sec_policy_write-before-analysis.il.expected b/src/test/correct/basic_sec_policy_write/clang_O2/basic_sec_policy_write-before-analysis.il.expected new file mode 100644 index 000000000..66390f0a2 --- /dev/null +++ b/src/test/correct/basic_sec_policy_write/clang_O2/basic_sec_policy_write-before-analysis.il.expected @@ -0,0 +1,307 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002ee", condition()) + ) + ) + Block("1752:l000002ee", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002fc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000315", condition()) + ) + ) + Block("1764:l00000315", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002fc", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000308", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000029d", condition()) + ) + ) + Block("1788:l0000029d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1840:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004ef", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000059a", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000365", condition()) + ) + ) + Block("1604:l000001dd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000365", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000347", condition()) + ) + ) + Block("1640:l00000347", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000035a", condition()) + ) + ) + Block("1660:l00000222", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000035a", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R10, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R10, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000329", condition()) + ) + ) + Block("1700:l00000329", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000033c", condition()) + ) + ) + Block("1720:l0000025e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000033c", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_sec_policy_write/clang_no_plt_no_pic/basic_sec_policy_write-before-analysis.il.expected b/src/test/correct/basic_sec_policy_write/clang_no_plt_no_pic/basic_sec_policy_write-before-analysis.il.expected new file mode 100644 index 000000000..e93cddbc8 --- /dev/null +++ b/src/test/correct/basic_sec_policy_write/clang_no_plt_no_pic/basic_sec_policy_write-before-analysis.il.expected @@ -0,0 +1,314 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008a2", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000923", condition()) + ) + ) + Block("1752:l00000923", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000931", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000094a", condition()) + ) + ) + Block("1764:l0000094a", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000931", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000093d", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008a2", condition()) + ) + ) + Block("1788:l000008a2", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1868:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1868:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b2b", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007cc", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000bbb", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000007e2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000099a", condition()) + ) + ) + Block("1604:l000007e2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000099a", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000827", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000097c", condition()) + ) + ) + Block("1640:l0000097c", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000827", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000098f", condition()) + ) + ) + Block("1660:l00000827", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000098f", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := Extract(Register(R10, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000863", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000095e", condition()) + ) + ) + Block("1700:l0000095e", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000863", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000971", condition()) + ) + ) + Block("1720:l00000863", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000971", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_sec_policy_write/clang_pic/basic_sec_policy_write-before-analysis.il.expected b/src/test/correct/basic_sec_policy_write/clang_pic/basic_sec_policy_write-before-analysis.il.expected new file mode 100644 index 000000000..1de3b2155 --- /dev/null +++ b/src/test/correct/basic_sec_policy_write/clang_pic/basic_sec_policy_write-before-analysis.il.expected @@ -0,0 +1,316 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002c1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000350", condition()) + ) + ) + Block("1816:l00000350", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) + ), + jumps( + GoTo("1840:l0000035e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000377", condition()) + ) + ) + Block("1828:l00000377", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000035e", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000036a", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002c1", condition()) + ) + ) + Block("1852:l000002c1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1940:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1940:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l000004fe", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001eb", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l00000599", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l00000201", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003c7", condition()) + ) + ) + Block("1668:l00000201", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003c7", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003a9", condition()) + ) + ) + Block("1704:l000003a9", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) + ), + jumps( + GoTo("1724:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003bc", condition()) + ) + ) + Block("1724:l00000246", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003bc", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4032bv64)])) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4040bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R10, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000038b", condition()) + ) + ) + Block("1764:l0000038b", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000039e", condition()) + ) + ) + Block("1784:l00000282", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000039e", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_sec_policy_write/gcc/basic_sec_policy_write-before-analysis.il.expected b/src/test/correct/basic_sec_policy_write/gcc/basic_sec_policy_write-before-analysis.il.expected new file mode 100644 index 000000000..78914f863 --- /dev/null +++ b/src/test/correct/basic_sec_policy_write/gcc/basic_sec_policy_write-before-analysis.il.expected @@ -0,0 +1,320 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002d1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000374", condition()) + ) + ) + Block("1752:l00000374", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000382", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000039b", condition()) + ) + ) + Block("1764:l0000039b", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000382", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000038e", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002d1", condition()) + ) + ) + Block("1788:l000002d1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1892:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1892:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000582", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001fb", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000063a", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000211", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003eb", condition()) + ) + ) + Block("1604:l00000211", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003eb", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003cd", condition()) + ) + ) + Block("1640:l000003cd", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003e0", condition()) + ) + ) + Block("1660:l00000256", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003e0", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003af", condition()) + ) + ) + Block("1700:l000003af", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003c2", condition()) + ) + ) + Block("1720:l00000292", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003c2", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_sec_policy_write/gcc_O2/basic_sec_policy_write-before-analysis.il.expected b/src/test/correct/basic_sec_policy_write/gcc_O2/basic_sec_policy_write-before-analysis.il.expected new file mode 100644 index 000000000..ababc3d28 --- /dev/null +++ b/src/test/correct/basic_sec_policy_write/gcc_O2/basic_sec_policy_write-before-analysis.il.expected @@ -0,0 +1,307 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002fc", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000325", condition()) + ) + ) + Block("1816:l00000325", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l00000333", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000034c", condition()) + ) + ) + Block("1828:l0000034c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000333", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000033f", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002fc", condition()) + ) + ) + Block("1852:l000002fc", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l0000052f", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000226", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005e3", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l0000023c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000039c", condition()) + ) + ) + Block("1668:l0000023c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000039c", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000281", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000037e", condition()) + ) + ) + Block("1704:l0000037e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000281", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000391", condition()) + ) + ) + Block("1724:l00000281", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000391", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) + LocalAssign(Register(R3, bv64) := 2bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R2, bv64), 4bv64)] := Extract(Register(R3, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000360", condition()) + ) + ) + Block("1764:l00000360", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000373", condition()) + ) + ) + Block("1784:l000002bd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000373", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_sec_policy_write/gcc_no_plt_no_pic/basic_sec_policy_write-before-analysis.il.expected b/src/test/correct/basic_sec_policy_write/gcc_no_plt_no_pic/basic_sec_policy_write-before-analysis.il.expected new file mode 100644 index 000000000..98e296e9f --- /dev/null +++ b/src/test/correct/basic_sec_policy_write/gcc_no_plt_no_pic/basic_sec_policy_write-before-analysis.il.expected @@ -0,0 +1,320 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000900", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000009a3", condition()) + ) + ) + Block("1752:l000009a3", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000009b1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009ca", condition()) + ) + ) + Block("1764:l000009ca", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000009b1", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009bd", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000900", condition()) + ) + ) + Block("1788:l00000900", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1892:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1892:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000bb1", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000082a", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c47", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000840", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a1a", condition()) + ) + ) + Block("1604:l00000840", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a1a", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000885", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009fc", condition()) + ) + ) + Block("1640:l000009fc", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000885", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a0f", condition()) + ) + ) + Block("1660:l00000885", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a0f", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009de", condition()) + ) + ) + Block("1700:l000009de", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000008c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009f1", condition()) + ) + ) + Block("1720:l000008c1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009f1", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basic_sec_policy_write/gcc_pic/basic_sec_policy_write-before-analysis.il.expected b/src/test/correct/basic_sec_policy_write/gcc_pic/basic_sec_policy_write-before-analysis.il.expected new file mode 100644 index 000000000..d20542a29 --- /dev/null +++ b/src/test/correct/basic_sec_policy_write/gcc_pic/basic_sec_policy_write-before-analysis.il.expected @@ -0,0 +1,320 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002d1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000378", condition()) + ) + ) + Block("1816:l00000378", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1840:l00000386", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000039f", condition()) + ) + ) + Block("1828:l0000039f", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000386", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000392", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002d1", condition()) + ) + ) + Block("1852:l000002d1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1956:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1956:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l00000526", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001fb", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l000005c5", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000211", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003ef", condition()) + ) + ) + Block("1668:l00000211", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003ef", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003d1", condition()) + ) + ) + Block("1704:l000003d1", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) + ), + jumps( + GoTo("1724:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003e4", condition()) + ) + ) + Block("1724:l00000256", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003e4", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R1, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003b3", condition()) + ) + ) + Block("1764:l000003b3", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003c6", condition()) + ) + ) + Block("1784:l00000292", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003c6", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basicassign_gamma0/clang/basicassign_gamma0-before-analysis.il.expected b/src/test/correct/basicassign_gamma0/clang/basicassign_gamma0-before-analysis.il.expected new file mode 100644 index 000000000..f70a1910e --- /dev/null +++ b/src/test/correct/basicassign_gamma0/clang/basicassign_gamma0-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002e5", condition()) + ) + ) + Block("1752:l000002e5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000030c", condition()) + ) + ) + Block("1764:l0000030c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002f3", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002ff", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000299", condition()) + ) + ) + Block("1788:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004e5", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000058f", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000035c", condition()) + ) + ) + Block("1604:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000035c", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000033e", condition()) + ) + ) + Block("1640:l0000033e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000351", condition()) + ) + ) + Block("1660:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000351", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(Register(R9, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000320", condition()) + ) + ) + Block("1700:l00000320", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000333", condition()) + ) + ) + Block("1720:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000333", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basicassign_gamma0/clang_O2/basicassign_gamma0-before-analysis.il.expected b/src/test/correct/basicassign_gamma0/clang_O2/basicassign_gamma0-before-analysis.il.expected new file mode 100644 index 000000000..0813e3426 --- /dev/null +++ b/src/test/correct/basicassign_gamma0/clang_O2/basicassign_gamma0-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002e5", condition()) + ) + ) + Block("1752:l000002e5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000030c", condition()) + ) + ) + Block("1764:l0000030c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002f3", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002ff", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000299", condition()) + ) + ) + Block("1788:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004e5", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000058f", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000035c", condition()) + ) + ) + Block("1604:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000035c", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000033e", condition()) + ) + ) + Block("1640:l0000033e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000351", condition()) + ) + ) + Block("1660:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000351", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000320", condition()) + ) + ) + Block("1700:l00000320", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000333", condition()) + ) + ) + Block("1720:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000333", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basicassign_gamma0/clang_no_plt_no_pic/basicassign_gamma0-before-analysis.il.expected b/src/test/correct/basicassign_gamma0/clang_no_plt_no_pic/basicassign_gamma0-before-analysis.il.expected new file mode 100644 index 000000000..1ce985d86 --- /dev/null +++ b/src/test/correct/basicassign_gamma0/clang_no_plt_no_pic/basicassign_gamma0-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000081d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000869", condition()) + ) + ) + Block("1752:l00000869", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000877", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000890", condition()) + ) + ) + Block("1764:l00000890", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000877", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000883", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000081d", condition()) + ) + ) + Block("1788:l0000081d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000a69", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000747", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000af1", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000075d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000008e0", condition()) + ) + ) + Block("1604:l0000075d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000008e0", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000007a2", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000008c2", condition()) + ) + ) + Block("1640:l000008c2", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l000007a2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000008d5", condition()) + ) + ) + Block("1660:l000007a2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000008d5", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(Register(R9, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000007de", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000008a4", condition()) + ) + ) + Block("1700:l000008a4", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000007de", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000008b7", condition()) + ) + ) + Block("1720:l000007de", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000008b7", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basicassign_gamma0/clang_pic/basicassign_gamma0-before-analysis.il.expected b/src/test/correct/basicassign_gamma0/clang_pic/basicassign_gamma0-before-analysis.il.expected new file mode 100644 index 000000000..cd2d2911e --- /dev/null +++ b/src/test/correct/basicassign_gamma0/clang_pic/basicassign_gamma0-before-analysis.il.expected @@ -0,0 +1,308 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002a1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000002fb", condition()) + ) + ) + Block("1816:l000002fb", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) + ), + jumps( + GoTo("1840:l00000309", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000322", condition()) + ) + ) + Block("1828:l00000322", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000309", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000315", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002a1", condition()) + ) + ) + Block("1852:l000002a1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1908:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1908:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l000004a9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001cb", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l0000053c", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1668:l000001e1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000372", condition()) + ) + ) + Block("1668:l000001e1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000372", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000354", condition()) + ) + ) + Block("1704:l00000354", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) + ), + jumps( + GoTo("1724:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000367", condition()) + ) + ) + Block("1724:l00000226", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000367", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4048bv64)])) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4032bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000336", condition()) + ) + ) + Block("1764:l00000336", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000349", condition()) + ) + ) + Block("1784:l00000262", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000349", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basicassign_gamma0/gcc/basicassign_gamma0-before-analysis.il.expected b/src/test/correct/basicassign_gamma0/gcc/basicassign_gamma0-before-analysis.il.expected new file mode 100644 index 000000000..0da535230 --- /dev/null +++ b/src/test/correct/basicassign_gamma0/gcc/basicassign_gamma0-before-analysis.il.expected @@ -0,0 +1,308 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002a1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002f9", condition()) + ) + ) + Block("1752:l000002f9", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000307", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000320", condition()) + ) + ) + Block("1764:l00000320", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000307", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000313", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002a1", condition()) + ) + ) + Block("1788:l000002a1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1844:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004fb", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001cb", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005a7", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000001e1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000370", condition()) + ) + ) + Block("1604:l000001e1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000370", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000352", condition()) + ) + ) + Block("1640:l00000352", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000365", condition()) + ) + ) + Block("1660:l00000226", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000365", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000334", condition()) + ) + ) + Block("1700:l00000334", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000347", condition()) + ) + ) + Block("1720:l00000262", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000347", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basicassign_gamma0/gcc_O2/basicassign_gamma0-before-analysis.il.expected b/src/test/correct/basicassign_gamma0/gcc_O2/basicassign_gamma0-before-analysis.il.expected new file mode 100644 index 000000000..22ecdd1d6 --- /dev/null +++ b/src/test/correct/basicassign_gamma0/gcc_O2/basicassign_gamma0-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000322", condition()) + ) + ) + Block("1816:l00000322", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l00000330", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000349", condition()) + ) + ) + Block("1828:l00000349", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000330", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000033c", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f9", condition()) + ) + ) + Block("1852:l000002f9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l0000052c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000223", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005e0", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000239", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000399", condition()) + ) + ) + Block("1668:l00000239", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000399", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000037b", condition()) + ) + ) + Block("1704:l0000037b", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l0000038e", condition()) + ) + ) + Block("1724:l0000027e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l0000038e", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R2, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R2, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000035d", condition()) + ) + ) + Block("1764:l0000035d", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000370", condition()) + ) + ) + Block("1784:l000002ba", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000370", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basicassign_gamma0/gcc_no_plt_no_pic/basicassign_gamma0-before-analysis.il.expected b/src/test/correct/basicassign_gamma0/gcc_no_plt_no_pic/basicassign_gamma0-before-analysis.il.expected new file mode 100644 index 000000000..2452063c1 --- /dev/null +++ b/src/test/correct/basicassign_gamma0/gcc_no_plt_no_pic/basicassign_gamma0-before-analysis.il.expected @@ -0,0 +1,308 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000083d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000895", condition()) + ) + ) + Block("1752:l00000895", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000008a3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000008bc", condition()) + ) + ) + Block("1764:l000008bc", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000008a3", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000008af", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000083d", condition()) + ) + ) + Block("1788:l0000083d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1844:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000a97", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000767", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000b21", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l0000077d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000090c", condition()) + ) + ) + Block("1604:l0000077d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000090c", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000007c2", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000008ee", condition()) + ) + ) + Block("1640:l000008ee", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l000007c2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000901", condition()) + ) + ) + Block("1660:l000007c2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000901", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000007fe", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000008d0", condition()) + ) + ) + Block("1700:l000008d0", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000007fe", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000008e3", condition()) + ) + ) + Block("1720:l000007fe", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000008e3", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basicassign_gamma0/gcc_pic/basicassign_gamma0-before-analysis.il.expected b/src/test/correct/basicassign_gamma0/gcc_pic/basicassign_gamma0-before-analysis.il.expected new file mode 100644 index 000000000..d3b140d48 --- /dev/null +++ b/src/test/correct/basicassign_gamma0/gcc_pic/basicassign_gamma0-before-analysis.il.expected @@ -0,0 +1,308 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002a1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000002fb", condition()) + ) + ) + Block("1816:l000002fb", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1840:l00000309", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000322", condition()) + ) + ) + Block("1828:l00000322", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000309", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000315", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002a1", condition()) + ) + ) + Block("1852:l000002a1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1908:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1908:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l000004a9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001cb", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l0000053c", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1668:l000001e1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000372", condition()) + ) + ) + Block("1668:l000001e1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000372", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000354", condition()) + ) + ) + Block("1704:l00000354", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) + ), + jumps( + GoTo("1724:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000367", condition()) + ) + ) + Block("1724:l00000226", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000367", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000336", condition()) + ) + ) + Block("1764:l00000336", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000349", condition()) + ) + ) + Block("1784:l00000262", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000349", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basicfree/clang/basicfree-before-analysis.il.expected b/src/test/correct/basicfree/clang/basicfree-before-analysis.il.expected new file mode 100644 index 000000000..cd3ee19eb --- /dev/null +++ b/src/test/correct/basicfree/clang/basicfree-before-analysis.il.expected @@ -0,0 +1,336 @@ +Procedure("1600:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 64bv64)]), 56)) + ), + jumps( + GoTo("1980:l000002b9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1944:l00000353", condition()) + ) + ) + Block("1944:l00000353", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1968:l00000361", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1956:l0000037a", condition()) + ) + ) + Block("1956:l0000037a", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 56bv64)])) + LocalAssign(Register(R30, bv64) := 1968bv64) + ), + jumps( + DirectCall("1600:__cxa_finalize", condition()) + ) + ) + Block("1968:l00000361", + statements( + LocalAssign(Register(R30, bv64) := 1972bv64) + ), + jumps( + DirectCall("1808:deregister_tm_clones", condition()) + ) + ) + Block("1972:l0000036d", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 64bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1980:l000002b9", condition()) + ) + ) + Block("1980:l000002b9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1584:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1584:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2060:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2060:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1520:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1536bv64) + ), + jumps( + DirectCall("1780:call_weak_fn", condition()) + ) + ) + Block("1536:l0000054d", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1584:__libc_start_main", condition()) + ) + ) + Block("1776:l000001e3", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1648:abort", condition()) + ) + ) + Block("?:l000005eb", + statements( + ), + jumps( + DirectCall("1780:call_weak_fn", condition()) + ) + ) +)), +Procedure("1648:abort", in(), out(), blocks( +)), +Procedure("1780:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1780:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1796:l000001f9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1792:l000003ca", condition()) + ) + ) + Block("1796:l000001f9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1792:l000003ca", + statements( + ), + jumps( + GoTo("1632:l__gmon_start__", condition()) + ) + ) + Block("1632:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1808:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 64bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 64bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1852:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1832:l000003ac", condition()) + ) + ) + Block("1832:l000003ac", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1852:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1844:l000003bf", condition()) + ) + ) + Block("1852:l0000023e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1844:l000003bf", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2000:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2000:lframe_dummy", + statements( + ), + jumps( + DirectCall("1856:register_tm_clones", condition()) + ) + ) +)), +Procedure("1664:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2004:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2004:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2024bv64) + ), + jumps( + DirectCall("1616:malloc", condition()) + ) + ) + Block("2024:l0000030d", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2048bv64) + ), + jumps( + DirectCall("1664:#free", condition()) + ) + ) + Block("2048:l00000338", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1616:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1856:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 64bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 64bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1912:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1892:l0000038e", condition()) + ) + ) + Block("1892:l0000038e", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1912:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1904:l000003a1", condition()) + ) + ) + Block("1912:l0000027a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1904:l000003a1", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basicfree/clang_O2/basicfree-before-analysis.il.expected b/src/test/correct/basicfree/clang_O2/basicfree-before-analysis.il.expected new file mode 100644 index 000000000..af5bdc2a2 --- /dev/null +++ b/src/test/correct/basicfree/clang_O2/basicfree-before-analysis.il.expected @@ -0,0 +1,301 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000285", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002b3", condition()) + ) + ) + Block("1752:l000002b3", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000002da", condition()) + ) + ) + Block("1764:l000002da", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002c1", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002cd", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000285", condition()) + ) + ) + Block("1788:l00000285", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1816:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1816:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004ae", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001af", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000553", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001c5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000032a", condition()) + ) + ) + Block("1604:l000001c5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000032a", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000020a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000030c", condition()) + ) + ) + Block("1640:l0000030c", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000020a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000031f", condition()) + ) + ) + Block("1660:l0000020a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000031f", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000002ee", condition()) + ) + ) + Block("1700:l000002ee", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000301", condition()) + ) + ) + Block("1720:l00000246", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000301", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basicfree/clang_no_plt_no_pic/basicfree-before-analysis.il.expected b/src/test/correct/basicfree/clang_no_plt_no_pic/basicfree-before-analysis.il.expected new file mode 100644 index 000000000..03c9de193 --- /dev/null +++ b/src/test/correct/basicfree/clang_no_plt_no_pic/basicfree-before-analysis.il.expected @@ -0,0 +1,336 @@ +Procedure("1600:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 64bv64)]), 56)) + ), + jumps( + GoTo("1980:l00000899", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1944:l00000933", condition()) + ) + ) + Block("1944:l00000933", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1968:l00000941", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1956:l0000095a", condition()) + ) + ) + Block("1956:l0000095a", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 56bv64)])) + LocalAssign(Register(R30, bv64) := 1968bv64) + ), + jumps( + DirectCall("1600:__cxa_finalize", condition()) + ) + ) + Block("1968:l00000941", + statements( + LocalAssign(Register(R30, bv64) := 1972bv64) + ), + jumps( + DirectCall("1808:deregister_tm_clones", condition()) + ) + ) + Block("1972:l0000094d", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 64bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1980:l00000899", condition()) + ) + ) + Block("1980:l00000899", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1584:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1584:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2060:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2060:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1520:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1536bv64) + ), + jumps( + DirectCall("1780:call_weak_fn", condition()) + ) + ) + Block("1536:l00000b2d", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1584:__libc_start_main", condition()) + ) + ) + Block("1776:l000007c3", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1648:abort", condition()) + ) + ) + Block("?:l00000ba4", + statements( + ), + jumps( + DirectCall("1780:call_weak_fn", condition()) + ) + ) +)), +Procedure("1648:abort", in(), out(), blocks( +)), +Procedure("1780:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1780:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1796:l000007d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1792:l000009aa", condition()) + ) + ) + Block("1796:l000007d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1792:l000009aa", + statements( + ), + jumps( + GoTo("1632:l__gmon_start__", condition()) + ) + ) + Block("1632:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1808:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 64bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 64bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1852:l0000081e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1832:l0000098c", condition()) + ) + ) + Block("1832:l0000098c", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1852:l0000081e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1844:l0000099f", condition()) + ) + ) + Block("1852:l0000081e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1844:l0000099f", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2000:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2000:lframe_dummy", + statements( + ), + jumps( + DirectCall("1856:register_tm_clones", condition()) + ) + ) +)), +Procedure("1664:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2004:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2004:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2024bv64) + ), + jumps( + DirectCall("1616:malloc", condition()) + ) + ) + Block("2024:l000008ed", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2048bv64) + ), + jumps( + DirectCall("1664:#free", condition()) + ) + ) + Block("2048:l00000918", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1616:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1856:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 64bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 64bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1912:l0000085a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1892:l0000096e", condition()) + ) + ) + Block("1892:l0000096e", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1912:l0000085a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1904:l00000981", condition()) + ) + ) + Block("1912:l0000085a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1904:l00000981", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basicfree/clang_pic/basicfree-before-analysis.il.expected b/src/test/correct/basicfree/clang_pic/basicfree-before-analysis.il.expected new file mode 100644 index 000000000..03c9de193 --- /dev/null +++ b/src/test/correct/basicfree/clang_pic/basicfree-before-analysis.il.expected @@ -0,0 +1,336 @@ +Procedure("1600:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 64bv64)]), 56)) + ), + jumps( + GoTo("1980:l00000899", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1944:l00000933", condition()) + ) + ) + Block("1944:l00000933", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1968:l00000941", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1956:l0000095a", condition()) + ) + ) + Block("1956:l0000095a", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 56bv64)])) + LocalAssign(Register(R30, bv64) := 1968bv64) + ), + jumps( + DirectCall("1600:__cxa_finalize", condition()) + ) + ) + Block("1968:l00000941", + statements( + LocalAssign(Register(R30, bv64) := 1972bv64) + ), + jumps( + DirectCall("1808:deregister_tm_clones", condition()) + ) + ) + Block("1972:l0000094d", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 64bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1980:l00000899", condition()) + ) + ) + Block("1980:l00000899", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1584:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1584:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2060:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2060:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1520:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1536bv64) + ), + jumps( + DirectCall("1780:call_weak_fn", condition()) + ) + ) + Block("1536:l00000b2d", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1584:__libc_start_main", condition()) + ) + ) + Block("1776:l000007c3", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1648:abort", condition()) + ) + ) + Block("?:l00000ba4", + statements( + ), + jumps( + DirectCall("1780:call_weak_fn", condition()) + ) + ) +)), +Procedure("1648:abort", in(), out(), blocks( +)), +Procedure("1780:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1780:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1796:l000007d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1792:l000009aa", condition()) + ) + ) + Block("1796:l000007d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1792:l000009aa", + statements( + ), + jumps( + GoTo("1632:l__gmon_start__", condition()) + ) + ) + Block("1632:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1808:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 64bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 64bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1852:l0000081e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1832:l0000098c", condition()) + ) + ) + Block("1832:l0000098c", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1852:l0000081e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1844:l0000099f", condition()) + ) + ) + Block("1852:l0000081e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1844:l0000099f", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2000:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2000:lframe_dummy", + statements( + ), + jumps( + DirectCall("1856:register_tm_clones", condition()) + ) + ) +)), +Procedure("1664:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2004:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2004:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2024bv64) + ), + jumps( + DirectCall("1616:malloc", condition()) + ) + ) + Block("2024:l000008ed", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2048bv64) + ), + jumps( + DirectCall("1664:#free", condition()) + ) + ) + Block("2048:l00000918", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1616:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1856:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 64bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 64bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1912:l0000085a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1892:l0000096e", condition()) + ) + ) + Block("1892:l0000096e", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1912:l0000085a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1904:l00000981", condition()) + ) + ) + Block("1912:l0000085a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1904:l00000981", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basicfree/gcc/basicfree-before-analysis.il.expected b/src/test/correct/basicfree/gcc/basicfree-before-analysis.il.expected new file mode 100644 index 000000000..0e6b40296 --- /dev/null +++ b/src/test/correct/basicfree/gcc/basicfree-before-analysis.il.expected @@ -0,0 +1,335 @@ +Procedure("1600:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1980:l000002b5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1944:l00000349", condition()) + ) + ) + Block("1944:l00000349", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1968:l00000357", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000370", condition()) + ) + ) + Block("1956:l00000370", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1968bv64) + ), + jumps( + DirectCall("1600:__cxa_finalize", condition()) + ) + ) + Block("1968:l00000357", + statements( + LocalAssign(Register(R30, bv64) := 1972bv64) + ), + jumps( + DirectCall("1808:deregister_tm_clones", condition()) + ) + ) + Block("1972:l00000363", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1980:l000002b5", condition()) + ) + ) + Block("1980:l000002b5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1584:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1584:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2056:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2056:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1520:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1536bv64) + ), + jumps( + DirectCall("1780:call_weak_fn", condition()) + ) + ) + Block("1536:l00000543", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1584:__libc_start_main", condition()) + ) + ) + Block("1776:l000001df", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1648:abort", condition()) + ) + ) + Block("?:l000005e0", + statements( + ), + jumps( + DirectCall("1780:call_weak_fn", condition()) + ) + ) +)), +Procedure("1648:abort", in(), out(), blocks( +)), +Procedure("1780:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1780:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1796:l000001f5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1792:l000003c0", condition()) + ) + ) + Block("1796:l000001f5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1792:l000003c0", + statements( + ), + jumps( + GoTo("1632:l__gmon_start__", condition()) + ) + ) + Block("1632:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1808:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1852:l0000023a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1832:l000003a2", condition()) + ) + ) + Block("1832:l000003a2", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1852:l0000023a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1844:l000003b5", condition()) + ) + ) + Block("1852:l0000023a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1844:l000003b5", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2000:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2000:lframe_dummy", + statements( + ), + jumps( + DirectCall("1856:register_tm_clones", condition()) + ) + ) +)), +Procedure("1664:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2004:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2004:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2020bv64) + ), + jumps( + DirectCall("1616:malloc", condition()) + ) + ) + Block("2020:l00000307", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R30, bv64) := 2044bv64) + ), + jumps( + DirectCall("1664:#free", condition()) + ) + ) + Block("2044:l00000332", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1616:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1856:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1912:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1892:l00000384", condition()) + ) + ) + Block("1892:l00000384", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1912:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1904:l00000397", condition()) + ) + ) + Block("1912:l00000276", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1904:l00000397", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basicfree/gcc_O2/basicfree-before-analysis.il.expected b/src/test/correct/basicfree/gcc_O2/basicfree-before-analysis.il.expected new file mode 100644 index 000000000..7387e4ace --- /dev/null +++ b/src/test/correct/basicfree/gcc_O2/basicfree-before-analysis.il.expected @@ -0,0 +1,301 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002e4", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000030d", condition()) + ) + ) + Block("1816:l0000030d", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000031b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000334", condition()) + ) + ) + Block("1828:l00000334", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000031b", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000327", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002e4", condition()) + ) + ) + Block("1852:l000002e4", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l00000517", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l0000020e", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005cb", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000224", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000384", condition()) + ) + ) + Block("1668:l00000224", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000384", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000269", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000366", condition()) + ) + ) + Block("1704:l00000366", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000269", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000379", condition()) + ) + ) + Block("1724:l00000269", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000379", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002a5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000348", condition()) + ) + ) + Block("1764:l00000348", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002a5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000035b", condition()) + ) + ) + Block("1784:l000002a5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000035b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basicfree/gcc_no_plt_no_pic/basicfree-before-analysis.il.expected b/src/test/correct/basicfree/gcc_no_plt_no_pic/basicfree-before-analysis.il.expected new file mode 100644 index 000000000..b7ac27390 --- /dev/null +++ b/src/test/correct/basicfree/gcc_no_plt_no_pic/basicfree-before-analysis.il.expected @@ -0,0 +1,335 @@ +Procedure("1600:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1980:l0000088a", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1944:l0000091e", condition()) + ) + ) + Block("1944:l0000091e", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1968:l0000092c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000945", condition()) + ) + ) + Block("1956:l00000945", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1968bv64) + ), + jumps( + DirectCall("1600:__cxa_finalize", condition()) + ) + ) + Block("1968:l0000092c", + statements( + LocalAssign(Register(R30, bv64) := 1972bv64) + ), + jumps( + DirectCall("1808:deregister_tm_clones", condition()) + ) + ) + Block("1972:l00000938", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1980:l0000088a", condition()) + ) + ) + Block("1980:l0000088a", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1584:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1584:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2056:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2056:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1520:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1536bv64) + ), + jumps( + DirectCall("1780:call_weak_fn", condition()) + ) + ) + Block("1536:l00000b18", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1584:__libc_start_main", condition()) + ) + ) + Block("1776:l000007b4", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1648:abort", condition()) + ) + ) + Block("?:l00000b8e", + statements( + ), + jumps( + DirectCall("1780:call_weak_fn", condition()) + ) + ) +)), +Procedure("1648:abort", in(), out(), blocks( +)), +Procedure("1780:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1780:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1796:l000007ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1792:l00000995", condition()) + ) + ) + Block("1796:l000007ca", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1792:l00000995", + statements( + ), + jumps( + GoTo("1632:l__gmon_start__", condition()) + ) + ) + Block("1632:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1808:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1852:l0000080f", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1832:l00000977", condition()) + ) + ) + Block("1832:l00000977", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1852:l0000080f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1844:l0000098a", condition()) + ) + ) + Block("1852:l0000080f", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1844:l0000098a", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2000:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2000:lframe_dummy", + statements( + ), + jumps( + DirectCall("1856:register_tm_clones", condition()) + ) + ) +)), +Procedure("1664:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2004:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2004:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2020bv64) + ), + jumps( + DirectCall("1616:malloc", condition()) + ) + ) + Block("2020:l000008dc", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R30, bv64) := 2044bv64) + ), + jumps( + DirectCall("1664:#free", condition()) + ) + ) + Block("2044:l00000907", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1616:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1856:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1912:l0000084b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1892:l00000959", condition()) + ) + ) + Block("1892:l00000959", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1912:l0000084b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1904:l0000096c", condition()) + ) + ) + Block("1912:l0000084b", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1904:l0000096c", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/basicfree/gcc_pic/basicfree-before-analysis.il.expected b/src/test/correct/basicfree/gcc_pic/basicfree-before-analysis.il.expected new file mode 100644 index 000000000..b7ac27390 --- /dev/null +++ b/src/test/correct/basicfree/gcc_pic/basicfree-before-analysis.il.expected @@ -0,0 +1,335 @@ +Procedure("1600:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1980:l0000088a", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1944:l0000091e", condition()) + ) + ) + Block("1944:l0000091e", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1968:l0000092c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000945", condition()) + ) + ) + Block("1956:l00000945", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1968bv64) + ), + jumps( + DirectCall("1600:__cxa_finalize", condition()) + ) + ) + Block("1968:l0000092c", + statements( + LocalAssign(Register(R30, bv64) := 1972bv64) + ), + jumps( + DirectCall("1808:deregister_tm_clones", condition()) + ) + ) + Block("1972:l00000938", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1980:l0000088a", condition()) + ) + ) + Block("1980:l0000088a", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1584:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1584:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2056:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2056:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1520:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1536bv64) + ), + jumps( + DirectCall("1780:call_weak_fn", condition()) + ) + ) + Block("1536:l00000b18", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1584:__libc_start_main", condition()) + ) + ) + Block("1776:l000007b4", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1648:abort", condition()) + ) + ) + Block("?:l00000b8e", + statements( + ), + jumps( + DirectCall("1780:call_weak_fn", condition()) + ) + ) +)), +Procedure("1648:abort", in(), out(), blocks( +)), +Procedure("1780:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1780:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1796:l000007ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1792:l00000995", condition()) + ) + ) + Block("1796:l000007ca", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1792:l00000995", + statements( + ), + jumps( + GoTo("1632:l__gmon_start__", condition()) + ) + ) + Block("1632:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1808:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1852:l0000080f", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1832:l00000977", condition()) + ) + ) + Block("1832:l00000977", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1852:l0000080f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1844:l0000098a", condition()) + ) + ) + Block("1852:l0000080f", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1844:l0000098a", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2000:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2000:lframe_dummy", + statements( + ), + jumps( + DirectCall("1856:register_tm_clones", condition()) + ) + ) +)), +Procedure("1664:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2004:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2004:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2020bv64) + ), + jumps( + DirectCall("1616:malloc", condition()) + ) + ) + Block("2020:l000008dc", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R30, bv64) := 2044bv64) + ), + jumps( + DirectCall("1664:#free", condition()) + ) + ) + Block("2044:l00000907", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1616:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1856:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1912:l0000084b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1892:l00000959", condition()) + ) + ) + Block("1892:l00000959", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1912:l0000084b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1904:l0000096c", condition()) + ) + ) + Block("1912:l0000084b", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1904:l0000096c", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/cjump/clang/cjump-before-analysis.il.expected b/src/test/correct/cjump/clang/cjump-before-analysis.il.expected new file mode 100644 index 000000000..e4c97e235 --- /dev/null +++ b/src/test/correct/cjump/clang/cjump-before-analysis.il.expected @@ -0,0 +1,374 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000398", condition()) + ) + ) + Block("1752:l00000398", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000003a6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003bf", condition()) + ) + ) + Block("1764:l000003bf", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000003a6", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000003b2", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002d5", condition()) + ) + ) + Block("1788:l000002d5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1896:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000005a7", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001ff", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000661", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000040f", condition()) + ) + ) + Block("1604:l00000215", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000040f", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003f1", condition()) + ) + ) + Block("1640:l000003f1", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000404", condition()) + ) + ) + Block("1660:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000404", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000343", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("?:l00000346", condition()) + ) + ) + Block("?:l00000346", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000349", condition()) + ) + ) + Block("?:l00000343", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000349", condition()) + ) + ) + Block("?:l00000349", + statements( + ), + jumps( + GoTo("1868:l00000351", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1848:l0000037e", condition()) + ) + ) + Block("1868:l00000351", + statements( + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1884:l00000369", condition()) + ) + ) + Block("1848:l0000037e", + statements( + ), + jumps( + GoTo("1852:l0000037f", condition()) + ) + ) + Block("1852:l0000037f", + statements( + LocalAssign(Register(R8, bv64) := 3bv64) + LocalAssign(Register(R9, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1884:l00000369", condition()) + ) + ) + Block("1884:l00000369", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003d3", condition()) + ) + ) + Block("1700:l000003d3", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003e6", condition()) + ) + ) + Block("1720:l00000296", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003e6", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/cjump/clang_O2/cjump-before-analysis.il.expected b/src/test/correct/cjump/clang_O2/cjump-before-analysis.il.expected new file mode 100644 index 000000000..4647f230f --- /dev/null +++ b/src/test/correct/cjump/clang_O2/cjump-before-analysis.il.expected @@ -0,0 +1,308 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002a1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002f8", condition()) + ) + ) + Block("1752:l000002f8", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000306", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000031f", condition()) + ) + ) + Block("1764:l0000031f", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000306", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000312", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002a1", condition()) + ) + ) + Block("1788:l000002a1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1844:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004fa", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001cb", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005a6", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001e1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000036f", condition()) + ) + ) + Block("1604:l000001e1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000036f", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000351", condition()) + ) + ) + Block("1640:l00000351", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000364", condition()) + ) + ) + Block("1660:l00000226", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000364", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 1bv64) + LocalAssign(Register(R10, bv64) := 69632bv64) + LocalAssign(Register(R11, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R10, bv64), 56bv64)] := Extract(Register(R11, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000333", condition()) + ) + ) + Block("1700:l00000333", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000346", condition()) + ) + ) + Block("1720:l00000262", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000346", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/cjump/clang_no_plt_no_pic/cjump-before-analysis.il.expected b/src/test/correct/cjump/clang_no_plt_no_pic/cjump-before-analysis.il.expected new file mode 100644 index 000000000..1196d843b --- /dev/null +++ b/src/test/correct/cjump/clang_no_plt_no_pic/cjump-before-analysis.il.expected @@ -0,0 +1,374 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000092b", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000009ee", condition()) + ) + ) + Block("1752:l000009ee", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000009fc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000a15", condition()) + ) + ) + Block("1764:l00000a15", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000009fc", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000a08", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000092b", condition()) + ) + ) + Block("1788:l0000092b", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1896:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000bfd", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000855", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c94", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000086b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a65", condition()) + ) + ) + Block("1604:l0000086b", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a65", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000008b0", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000a47", condition()) + ) + ) + Block("1640:l00000a47", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l000008b0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a5a", condition()) + ) + ) + Block("1660:l000008b0", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a5a", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000999", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("?:l0000099c", condition()) + ) + ) + Block("?:l0000099c", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l0000099f", condition()) + ) + ) + Block("?:l00000999", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l0000099f", condition()) + ) + ) + Block("?:l0000099f", + statements( + ), + jumps( + GoTo("1868:l000009a7", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1848:l000009d4", condition()) + ) + ) + Block("1868:l000009a7", + statements( + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1884:l000009bf", condition()) + ) + ) + Block("1848:l000009d4", + statements( + ), + jumps( + GoTo("1852:l000009d5", condition()) + ) + ) + Block("1852:l000009d5", + statements( + LocalAssign(Register(R8, bv64) := 3bv64) + LocalAssign(Register(R9, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1884:l000009bf", condition()) + ) + ) + Block("1884:l000009bf", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008ec", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000a29", condition()) + ) + ) + Block("1700:l00000a29", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000008ec", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000a3c", condition()) + ) + ) + Block("1720:l000008ec", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000a3c", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/cjump/clang_pic/cjump-before-analysis.il.expected b/src/test/correct/cjump/clang_pic/cjump-before-analysis.il.expected new file mode 100644 index 000000000..63f4053e8 --- /dev/null +++ b/src/test/correct/cjump/clang_pic/cjump-before-analysis.il.expected @@ -0,0 +1,377 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002e1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000003b9", condition()) + ) + ) + Block("1816:l000003b9", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) + ), + jumps( + GoTo("1840:l000003c7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l000003e0", condition()) + ) + ) + Block("1828:l000003e0", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l000003c7", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000003d3", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002e1", condition()) + ) + ) + Block("1852:l000002e1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1972:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1972:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l00000567", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l0000020b", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l0000060b", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1668:l00000221", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000430", condition()) + ) + ) + Block("1668:l00000221", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000430", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000412", condition()) + ) + ) + Block("1704:l00000412", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) + ), + jumps( + GoTo("1724:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000425", condition()) + ) + ) + Block("1724:l00000266", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000425", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) + LocalAssign(Register(R9, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R9, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000356", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("?:l00000359", condition()) + ) + ) + Block("?:l00000359", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l0000035c", condition()) + ) + ) + Block("?:l00000356", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l0000035c", condition()) + ) + ) + Block("?:l0000035c", + statements( + ), + jumps( + GoTo("1940:l00000364", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1916:l00000398", condition()) + ) + ) + Block("1940:l00000364", + statements( + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4048bv64)])) + LocalAssign(Register(R8, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1960:l00000383", condition()) + ) + ) + Block("1916:l00000398", + statements( + ), + jumps( + GoTo("1920:l00000399", condition()) + ) + ) + Block("1920:l00000399", + statements( + LocalAssign(Register(R8, bv64) := 3bv64) + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4048bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1960:l00000383", condition()) + ) + ) + Block("1960:l00000383", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002a2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003f4", condition()) + ) + ) + Block("1764:l000003f4", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l000002a2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000407", condition()) + ) + ) + Block("1784:l000002a2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000407", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/cjump/gcc/cjump-before-analysis.il.expected b/src/test/correct/cjump/gcc/cjump-before-analysis.il.expected new file mode 100644 index 000000000..0426467dd --- /dev/null +++ b/src/test/correct/cjump/gcc/cjump-before-analysis.il.expected @@ -0,0 +1,344 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002d1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000381", condition()) + ) + ) + Block("1752:l00000381", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l0000038f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003a8", condition()) + ) + ) + Block("1764:l000003a8", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000038f", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000039b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002d1", condition()) + ) + ) + Block("1788:l000002d1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1892:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1892:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l0000058f", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001fb", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000649", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000211", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003f8", condition()) + ) + ) + Block("1604:l00000211", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003f8", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003da", condition()) + ) + ) + Block("1640:l000003da", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003ed", condition()) + ) + ) + Block("1660:l00000256", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003ed", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1868:l0000033e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1848:l00000365", condition()) + ) + ) + Block("1868:l0000033e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + GoTo("1884:l0000035b", condition()) + ) + ) + Block("1848:l00000365", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + GoTo("1884:l0000035b", condition()) + ) + ) + Block("1884:l0000035b", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003bc", condition()) + ) + ) + Block("1700:l000003bc", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003cf", condition()) + ) + ) + Block("1720:l00000292", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003cf", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/cjump/gcc_O2/cjump-before-analysis.il.expected b/src/test/correct/cjump/gcc_O2/cjump-before-analysis.il.expected new file mode 100644 index 000000000..098ce384c --- /dev/null +++ b/src/test/correct/cjump/gcc_O2/cjump-before-analysis.il.expected @@ -0,0 +1,308 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l00000300", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000329", condition()) + ) + ) + Block("1816:l00000329", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l00000337", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000350", condition()) + ) + ) + Block("1828:l00000350", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000337", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000343", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l00000300", condition()) + ) + ) + Block("1852:l00000300", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l00000533", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l0000022a", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005e7", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000240", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003a0", condition()) + ) + ) + Block("1668:l00000240", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003a0", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000285", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000382", condition()) + ) + ) + Block("1704:l00000382", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000285", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000395", condition()) + ) + ) + Block("1724:l00000285", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000395", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R3, bv64) := 1bv64) + LocalAssign(Register(R2, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R0, bv64), 20bv64)] := Extract(Register(R3, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 4bv64)] := Extract(Register(R2, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000364", condition()) + ) + ) + Block("1764:l00000364", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000377", condition()) + ) + ) + Block("1784:l000002c1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000377", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/cjump/gcc_no_plt_no_pic/cjump-before-analysis.il.expected b/src/test/correct/cjump/gcc_no_plt_no_pic/cjump-before-analysis.il.expected new file mode 100644 index 000000000..c9d5fd639 --- /dev/null +++ b/src/test/correct/cjump/gcc_no_plt_no_pic/cjump-before-analysis.il.expected @@ -0,0 +1,344 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000090f", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000009bf", condition()) + ) + ) + Block("1752:l000009bf", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000009cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009e6", condition()) + ) + ) + Block("1764:l000009e6", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000009cd", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009d9", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000090f", condition()) + ) + ) + Block("1788:l0000090f", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1892:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1892:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000bcd", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000839", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c63", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l0000084f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a36", condition()) + ) + ) + Block("1604:l0000084f", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a36", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000894", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000a18", condition()) + ) + ) + Block("1640:l00000a18", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000894", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a2b", condition()) + ) + ) + Block("1660:l00000894", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a2b", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1868:l0000097c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1848:l000009a3", condition()) + ) + ) + Block("1868:l0000097c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + GoTo("1884:l00000999", condition()) + ) + ) + Block("1848:l000009a3", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + GoTo("1884:l00000999", condition()) + ) + ) + Block("1884:l00000999", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008d0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009fa", condition()) + ) + ) + Block("1700:l000009fa", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000008d0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000a0d", condition()) + ) + ) + Block("1720:l000008d0", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000a0d", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/cjump/gcc_pic/cjump-before-analysis.il.expected b/src/test/correct/cjump/gcc_pic/cjump-before-analysis.il.expected new file mode 100644 index 000000000..46cddab65 --- /dev/null +++ b/src/test/correct/cjump/gcc_pic/cjump-before-analysis.il.expected @@ -0,0 +1,344 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002d1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000385", condition()) + ) + ) + Block("1816:l00000385", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1840:l00000393", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l000003ac", condition()) + ) + ) + Block("1828:l000003ac", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000393", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000039f", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002d1", condition()) + ) + ) + Block("1852:l000002d1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1956:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1956:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l00000533", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001fb", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l000005d4", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1668:l00000211", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003fc", condition()) + ) + ) + Block("1668:l00000211", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003fc", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003de", condition()) + ) + ) + Block("1704:l000003de", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) + ), + jumps( + GoTo("1724:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003f1", condition()) + ) + ) + Block("1724:l00000256", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003f1", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1932:l00000340", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1912:l00000368", condition()) + ) + ) + Block("1932:l00000340", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + LocalAssign(Register(R1, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + GoTo("1948:l0000035e", condition()) + ) + ) + Block("1912:l00000368", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + LocalAssign(Register(R1, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + GoTo("1948:l0000035e", condition()) + ) + ) + Block("1948:l0000035e", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003c0", condition()) + ) + ) + Block("1764:l000003c0", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003d3", condition()) + ) + ) + Block("1784:l00000292", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003d3", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/function/clang/function-before-analysis.il.expected b/src/test/correct/function/clang/function-before-analysis.il.expected new file mode 100644 index 000000000..4d53dcfd6 --- /dev/null +++ b/src/test/correct/function/clang/function-before-analysis.il.expected @@ -0,0 +1,333 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008a8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000937", condition()) + ) + ) + Block("1752:l00000937", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000945", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000095e", condition()) + ) + ) + Block("1764:l0000095e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000945", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000951", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008a8", condition()) + ) + ) + Block("1788:l000008a8", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1864:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1864:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b3e", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007d2", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000bcd", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000007e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000009ae", condition()) + ) + ) + Block("1604:l000007e8", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000009ae", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000082d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000990", condition()) + ) + ) + Block("1640:l00000990", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000082d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009a3", condition()) + ) + ) + Block("1660:l0000082d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009a3", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1856:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:lget_two", + statements( + LocalAssign(Register(R0, bv64) := 2bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 1836bv64) + ), + jumps( + DirectCall("1856:get_two", condition()) + ) + ) + Block("1836:l00000910", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000869", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000972", condition()) + ) + ) + Block("1700:l00000972", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000869", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000985", condition()) + ) + ) + Block("1720:l00000869", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000985", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/function/clang_O2/function-before-analysis.il.expected b/src/test/correct/function/clang_O2/function-before-analysis.il.expected new file mode 100644 index 000000000..b92c99a72 --- /dev/null +++ b/src/test/correct/function/clang_O2/function-before-analysis.il.expected @@ -0,0 +1,318 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002a9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000030a", condition()) + ) + ) + Block("1752:l0000030a", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000318", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000331", condition()) + ) + ) + Block("1764:l00000331", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000318", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000324", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002a9", condition()) + ) + ) + Block("1788:l000002a9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1852:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1852:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l0000050e", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001d3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005be", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001e9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000381", condition()) + ) + ) + Block("1604:l000001e9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000381", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000022e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000363", condition()) + ) + ) + Block("1640:l00000363", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000022e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000376", condition()) + ) + ) + Block("1660:l0000022e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000376", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1844:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lget_two", + statements( + LocalAssign(Register(R0, bv64) := 2bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 1bv64) + LocalAssign(Register(R10, bv64) := 69632bv64) + LocalAssign(Register(R11, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R10, bv64), 56bv64)] := Extract(Register(R11, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000026a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000345", condition()) + ) + ) + Block("1700:l00000345", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000026a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000358", condition()) + ) + ) + Block("1720:l0000026a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000358", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/function/clang_no_plt_no_pic/function-before-analysis.il.expected b/src/test/correct/function/clang_no_plt_no_pic/function-before-analysis.il.expected new file mode 100644 index 000000000..4d53dcfd6 --- /dev/null +++ b/src/test/correct/function/clang_no_plt_no_pic/function-before-analysis.il.expected @@ -0,0 +1,333 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008a8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000937", condition()) + ) + ) + Block("1752:l00000937", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000945", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000095e", condition()) + ) + ) + Block("1764:l0000095e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000945", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000951", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008a8", condition()) + ) + ) + Block("1788:l000008a8", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1864:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1864:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b3e", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007d2", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000bcd", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000007e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000009ae", condition()) + ) + ) + Block("1604:l000007e8", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000009ae", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000082d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000990", condition()) + ) + ) + Block("1640:l00000990", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000082d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009a3", condition()) + ) + ) + Block("1660:l0000082d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009a3", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1856:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:lget_two", + statements( + LocalAssign(Register(R0, bv64) := 2bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 1836bv64) + ), + jumps( + DirectCall("1856:get_two", condition()) + ) + ) + Block("1836:l00000910", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000869", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000972", condition()) + ) + ) + Block("1700:l00000972", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000869", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000985", condition()) + ) + ) + Block("1720:l00000869", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000985", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/function/clang_pic/function-before-analysis.il.expected b/src/test/correct/function/clang_pic/function-before-analysis.il.expected new file mode 100644 index 000000000..999b2435a --- /dev/null +++ b/src/test/correct/function/clang_pic/function-before-analysis.il.expected @@ -0,0 +1,335 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000035a", condition()) + ) + ) + Block("1816:l0000035a", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) + ), + jumps( + GoTo("1840:l00000368", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000381", condition()) + ) + ) + Block("1828:l00000381", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000368", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000374", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002bd", condition()) + ) + ) + Block("1852:l000002bd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1936:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1936:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l00000508", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001e7", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l000005a4", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1668:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003d1", condition()) + ) + ) + Block("1668:l000001fd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003d1", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003b3", condition()) + ) + ) + Block("1704:l000003b3", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) + ), + jumps( + GoTo("1724:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003c6", condition()) + ) + ) + Block("1724:l00000242", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003c6", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1928:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1928:lget_two", + statements( + LocalAssign(Register(R0, bv64) := 2bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4032bv64)])) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 1904bv64) + ), + jumps( + DirectCall("1928:get_two", condition()) + ) + ) + Block("1904:l0000032c", + statements( + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4048bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000395", condition()) + ) + ) + Block("1764:l00000395", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003a8", condition()) + ) + ) + Block("1784:l0000027e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003a8", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/function/gcc/function-before-analysis.il.expected b/src/test/correct/function/gcc/function-before-analysis.il.expected new file mode 100644 index 000000000..709205956 --- /dev/null +++ b/src/test/correct/function/gcc/function-before-analysis.il.expected @@ -0,0 +1,336 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008d8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000979", condition()) + ) + ) + Block("1752:l00000979", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000987", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009a0", condition()) + ) + ) + Block("1764:l000009a0", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000987", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000993", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008d8", condition()) + ) + ) + Block("1788:l000008d8", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b83", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000802", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c15", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000818", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000009f0", condition()) + ) + ) + Block("1604:l00000818", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000009f0", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009d2", condition()) + ) + ) + Block("1640:l000009d2", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009e5", condition()) + ) + ) + Block("1660:l0000085d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009e5", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1868:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1868:lget_two", + statements( + LocalAssign(Register(R0, bv64) := 2bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1868:get_two", condition()) + ) + ) + Block("1840:l00000946", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000899", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009b4", condition()) + ) + ) + Block("1700:l000009b4", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000899", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009c7", condition()) + ) + ) + Block("1720:l00000899", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009c7", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/function/gcc_O2/function-before-analysis.il.expected b/src/test/correct/function/gcc_O2/function-before-analysis.il.expected new file mode 100644 index 000000000..03a119e35 --- /dev/null +++ b/src/test/correct/function/gcc_O2/function-before-analysis.il.expected @@ -0,0 +1,318 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l00000314", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000034d", condition()) + ) + ) + Block("1816:l0000034d", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000035b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000374", condition()) + ) + ) + Block("1828:l00000374", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000035b", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000367", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l00000314", condition()) + ) + ) + Block("1852:l00000314", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1896:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l0000055c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l0000023e", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000617", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000254", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003c4", condition()) + ) + ) + Block("1668:l00000254", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003c4", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000299", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003a6", condition()) + ) + ) + Block("1704:l000003a6", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000299", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003b9", condition()) + ) + ) + Block("1724:l00000299", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003b9", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1888:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1888:lget_two", + statements( + LocalAssign(Register(R0, bv64) := 2bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R3, bv64) := 1bv64) + LocalAssign(Register(R2, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R0, bv64), 20bv64)] := Extract(Register(R3, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 4bv64)] := Extract(Register(R2, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000388", condition()) + ) + ) + Block("1764:l00000388", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000039b", condition()) + ) + ) + Block("1784:l000002d5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000039b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/function/gcc_no_plt_no_pic/function-before-analysis.il.expected b/src/test/correct/function/gcc_no_plt_no_pic/function-before-analysis.il.expected new file mode 100644 index 000000000..709205956 --- /dev/null +++ b/src/test/correct/function/gcc_no_plt_no_pic/function-before-analysis.il.expected @@ -0,0 +1,336 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008d8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000979", condition()) + ) + ) + Block("1752:l00000979", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000987", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009a0", condition()) + ) + ) + Block("1764:l000009a0", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000987", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000993", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008d8", condition()) + ) + ) + Block("1788:l000008d8", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b83", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000802", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c15", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000818", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000009f0", condition()) + ) + ) + Block("1604:l00000818", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000009f0", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009d2", condition()) + ) + ) + Block("1640:l000009d2", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009e5", condition()) + ) + ) + Block("1660:l0000085d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009e5", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1868:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1868:lget_two", + statements( + LocalAssign(Register(R0, bv64) := 2bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1868:get_two", condition()) + ) + ) + Block("1840:l00000946", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000899", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009b4", condition()) + ) + ) + Block("1700:l000009b4", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000899", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009c7", condition()) + ) + ) + Block("1720:l00000899", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009c7", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/function/gcc_pic/function-before-analysis.il.expected b/src/test/correct/function/gcc_pic/function-before-analysis.il.expected new file mode 100644 index 000000000..5c0173591 --- /dev/null +++ b/src/test/correct/function/gcc_pic/function-before-analysis.il.expected @@ -0,0 +1,336 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002c1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000364", condition()) + ) + ) + Block("1816:l00000364", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1840:l00000372", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000038b", condition()) + ) + ) + Block("1828:l0000038b", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000372", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000037e", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002c1", condition()) + ) + ) + Block("1852:l000002c1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1940:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1940:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l00000512", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001eb", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l000005af", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1668:l00000201", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003db", condition()) + ) + ) + Block("1668:l00000201", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003db", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003bd", condition()) + ) + ) + Block("1704:l000003bd", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) + ), + jumps( + GoTo("1724:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003d0", condition()) + ) + ) + Block("1724:l00000246", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003d0", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1932:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1932:lget_two", + statements( + LocalAssign(Register(R0, bv64) := 2bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 1904bv64) + ), + jumps( + DirectCall("1932:get_two", condition()) + ) + ) + Block("1904:l00000330", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000039f", condition()) + ) + ) + Block("1764:l0000039f", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003b2", condition()) + ) + ) + Block("1784:l00000282", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003b2", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/function1/clang/function1-before-analysis.il.expected b/src/test/correct/function1/clang/function1-before-analysis.il.expected new file mode 100644 index 000000000..606bfb205 --- /dev/null +++ b/src/test/correct/function1/clang/function1-before-analysis.il.expected @@ -0,0 +1,361 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) + ), + jumps( + GoTo("1852:l00000301", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000040f", condition()) + ) + ) + Block("1816:l0000040f", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1840:l0000041d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000436", condition()) + ) + ) + Block("1828:l00000436", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000041d", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000429", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l00000301", condition()) + ) + ) + Block("1852:l00000301", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2004:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2004:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1464:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1480bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1480:l0000064f", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l0000022b", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l0000071c", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l00000241", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000486", condition()) + ) + ) + Block("1668:l00000241", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000486", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000468", condition()) + ) + ) + Block("1704:l00000468", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1724:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l0000047b", condition()) + ) + ) + Block("1724:l00000286", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l0000047b", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:lget_two", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R1, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R2, bv64))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R9, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), Extract(Register(R9, bv64)[32:0])), 32)) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R8, bv64) := BinaryExpr("add", Register(R8, bv64), SignExtend(Extract(Register(R9, bv64)[32:0]), 32))) + LocalAssign(Register(R0, bv64) := ZeroExtend(Extract(Register(R8, bv64)[32:0]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1924:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1924:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 60bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 97bv64) + LocalAssign(Register(R1, bv64) := 10bv64) + LocalAssign(Register(R2, bv64) := 58368bv64) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:32]), BinaryExpr("++", 21515bv16, Extract(Register(R2, bv64)[16:0])))) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:48]), BinaryExpr("++", 2bv16, Extract(Register(R2, bv64)[32:0])))) + LocalAssign(Register(R30, bv64) := 1968bv64) + ), + jumps( + DirectCall("1876:get_two", condition()) + ) + ) + Block("1968:l000003ce", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 64bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 64bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2028bv64)) + LocalAssign(Register(R30, bv64) := 1992bv64) + ), + jumps( + DirectCall("1584:printf", condition()) + ) + ) + Block("1992:l000003f5", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1584:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002c2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000044a", condition()) + ) + ) + Block("1764:l0000044a", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l000002c2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000045d", condition()) + ) + ) + Block("1784:l000002c2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000045d", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/function1/clang_O2/function1-before-analysis.il.expected b/src/test/correct/function1/clang_O2/function1-before-analysis.il.expected new file mode 100644 index 000000000..5356989a2 --- /dev/null +++ b/src/test/correct/function1/clang_O2/function1-before-analysis.il.expected @@ -0,0 +1,342 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002d1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000038b", condition()) + ) + ) + Block("1816:l0000038b", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1840:l00000399", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l000003b2", condition()) + ) + ) + Block("1828:l000003b2", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000399", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000003a5", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002d1", condition()) + ) + ) + Block("1852:l000002d1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1956:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1956:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1464:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1480bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1480:l000005bf", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001fb", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l00000680", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l00000211", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000402", condition()) + ) + ) + Block("1668:l00000211", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000402", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003e4", condition()) + ) + ) + Block("1704:l000003e4", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1724:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003f7", condition()) + ) + ) + Block("1724:l00000256", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003f7", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:lget_two", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R1, bv64)[32:0]), BinaryExpr("++", 0bv24, Extract(Register(R0, bv64)[8:0]))), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), Extract(Register(R2, bv64)[32:0])), 32)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1888:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1888:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R11, bv64) := 58475bv64) + LocalAssign(Register(R1, bv64) := 58475bv64) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 1bv64) + LocalAssign(Register(R10, bv64) := 69632bv64) + LocalAssign(Register(R11, bv64) := ZeroExtend(BinaryExpr("++", 21515bv16, Extract(Register(R11, bv64)[16:0])), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1980bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("++", 21515bv16, Extract(Register(R1, bv64)[16:0])), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 60bv64)] := Extract(Register(R9, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R10, bv64), 64bv64)] := Extract(Register(R11, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 1944bv64) + ), + jumps( + DirectCall("1584:printf", condition()) + ) + ) + Block("1944:l00000371", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1584:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003c6", condition()) + ) + ) + Block("1764:l000003c6", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003d9", condition()) + ) + ) + Block("1784:l00000292", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003d9", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/function1/clang_no_plt_no_pic/function1-before-analysis.il.expected b/src/test/correct/function1/clang_no_plt_no_pic/function1-before-analysis.il.expected new file mode 100644 index 000000000..74d92e622 --- /dev/null +++ b/src/test/correct/function1/clang_no_plt_no_pic/function1-before-analysis.il.expected @@ -0,0 +1,361 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) + ), + jumps( + GoTo("1852:l00000a12", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000b20", condition()) + ) + ) + Block("1816:l00000b20", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1840:l00000b2e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000b47", condition()) + ) + ) + Block("1828:l00000b47", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000b2e", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000b3a", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l00000a12", condition()) + ) + ) + Block("1852:l00000a12", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2004:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2004:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1464:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1480bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1480:l00000d60", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l0000093c", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l00000e06", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l00000952", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000b97", condition()) + ) + ) + Block("1668:l00000952", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000b97", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000997", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000b79", condition()) + ) + ) + Block("1704:l00000b79", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1724:l00000997", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000b8c", condition()) + ) + ) + Block("1724:l00000997", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000b8c", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:lget_two", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R1, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R2, bv64))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R9, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), Extract(Register(R9, bv64)[32:0])), 32)) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R8, bv64) := BinaryExpr("add", Register(R8, bv64), SignExtend(Extract(Register(R9, bv64)[32:0]), 32))) + LocalAssign(Register(R0, bv64) := ZeroExtend(Extract(Register(R8, bv64)[32:0]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1924:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1924:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 60bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 97bv64) + LocalAssign(Register(R1, bv64) := 10bv64) + LocalAssign(Register(R2, bv64) := 58368bv64) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:32]), BinaryExpr("++", 21515bv16, Extract(Register(R2, bv64)[16:0])))) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:48]), BinaryExpr("++", 2bv16, Extract(Register(R2, bv64)[32:0])))) + LocalAssign(Register(R30, bv64) := 1968bv64) + ), + jumps( + DirectCall("1876:get_two", condition()) + ) + ) + Block("1968:l00000adf", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 64bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 64bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2028bv64)) + LocalAssign(Register(R30, bv64) := 1992bv64) + ), + jumps( + DirectCall("1584:printf", condition()) + ) + ) + Block("1992:l00000b06", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1584:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000009d3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000b5b", condition()) + ) + ) + Block("1764:l00000b5b", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l000009d3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000b6e", condition()) + ) + ) + Block("1784:l000009d3", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000b6e", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/function1/clang_pic/function1-before-analysis.il.expected b/src/test/correct/function1/clang_pic/function1-before-analysis.il.expected new file mode 100644 index 000000000..fee1a805a --- /dev/null +++ b/src/test/correct/function1/clang_pic/function1-before-analysis.il.expected @@ -0,0 +1,363 @@ +Procedure("1584:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1856:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) + ), + jumps( + GoTo("1916:l00000309", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1880:l00000425", condition()) + ) + ) + Block("1880:l00000425", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) + ), + jumps( + GoTo("1904:l00000433", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1892:l0000044c", condition()) + ) + ) + Block("1892:l0000044c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) + LocalAssign(Register(R30, bv64) := 1904bv64) + ), + jumps( + DirectCall("1584:__cxa_finalize", condition()) + ) + ) + Block("1904:l00000433", + statements( + LocalAssign(Register(R30, bv64) := 1908bv64) + ), + jumps( + DirectCall("1744:deregister_tm_clones", condition()) + ) + ) + Block("1908:l0000043f", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1916:l00000309", condition()) + ) + ) + Block("1916:l00000309", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1568:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1568:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2076:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2076:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1512:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1512:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1528bv64) + ), + jumps( + DirectCall("1716:call_weak_fn", condition()) + ) + ) + Block("1528:l000005f9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1712bv64) + ), + jumps( + DirectCall("1568:__libc_start_main", condition()) + ) + ) + Block("1712:l00000233", + statements( + LocalAssign(Register(R30, bv64) := 1716bv64) + ), + jumps( + DirectCall("1616:abort", condition()) + ) + ) + Block("?:l000006c8", + statements( + ), + jumps( + DirectCall("1716:call_weak_fn", condition()) + ) + ) +)), +Procedure("1616:abort", in(), out(), blocks( +)), +Procedure("1716:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1716:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1732:l00000249", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1728:l0000049c", condition()) + ) + ) + Block("1732:l00000249", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1728:l0000049c", + statements( + ), + jumps( + GoTo("1600:l__gmon_start__", condition()) + ) + ) + Block("1600:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1744:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1744:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1788:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1768:l0000047e", condition()) + ) + ) + Block("1768:l0000047e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) + ), + jumps( + GoTo("1788:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1780:l00000491", condition()) + ) + ) + Block("1788:l0000028e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1780:l00000491", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1936:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1936:lframe_dummy", + statements( + ), + jumps( + DirectCall("1792:register_tm_clones", condition()) + ) + ) +)), +Procedure("1940:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1940:lget_two", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R1, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R2, bv64))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R9, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), Extract(Register(R9, bv64)[32:0])), 32)) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R8, bv64) := BinaryExpr("add", Register(R8, bv64), SignExtend(Extract(Register(R9, bv64)[32:0]), 32))) + LocalAssign(Register(R0, bv64) := ZeroExtend(Extract(Register(R8, bv64)[32:0]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1988:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1988:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4032bv64)])) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 97bv64) + LocalAssign(Register(R1, bv64) := 10bv64) + LocalAssign(Register(R2, bv64) := 58368bv64) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:32]), BinaryExpr("++", 21515bv16, Extract(Register(R2, bv64)[16:0])))) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:48]), BinaryExpr("++", 2bv16, Extract(Register(R2, bv64)[32:0])))) + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1940:get_two", condition()) + ) + ) + Block("2036:l000003dd", + statements( + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4048bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2100bv64)) + LocalAssign(Register(R30, bv64) := 2064bv64) + ), + jumps( + DirectCall("1632:printf", condition()) + ) + ) + Block("2064:l0000040b", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1848:l000002ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000460", condition()) + ) + ) + Block("1828:l00000460", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1848:l000002ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1840:l00000473", condition()) + ) + ) + Block("1848:l000002ca", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1840:l00000473", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/function1/gcc/function1-before-analysis.il.expected b/src/test/correct/function1/gcc/function1-before-analysis.il.expected new file mode 100644 index 000000000..a63150732 --- /dev/null +++ b/src/test/correct/function1/gcc/function1-before-analysis.il.expected @@ -0,0 +1,367 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l00000319", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000044a", condition()) + ) + ) + Block("1816:l0000044a", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l00000458", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000471", condition()) + ) + ) + Block("1828:l00000471", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000458", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000464", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l00000319", condition()) + ) + ) + Block("1852:l00000319", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2028:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2028:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1464:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1480bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1480:l00000690", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l00000243", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l00000763", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000259", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000004c1", condition()) + ) + ) + Block("1668:l00000259", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000004c1", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000029e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000004a3", condition()) + ) + ) + Block("1704:l000004a3", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l0000029e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000004b6", condition()) + ) + ) + Block("1724:l0000029e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000004b6", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:lget_two", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R1, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R2, bv64))) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1924:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1924:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R2, bv64) := 58368bv64) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:32]), BinaryExpr("++", 21515bv16, Extract(Register(R2, bv64)[16:0])))) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:48]), BinaryExpr("++", 2bv16, Extract(Register(R2, bv64)[32:0])))) + LocalAssign(Register(R1, bv64) := 10bv64) + LocalAssign(Register(R0, bv64) := 97bv64) + LocalAssign(Register(R30, bv64) := 1972bv64) + ), + jumps( + DirectCall("1876:get_two", condition()) + ) + ) + Block("1972:l000003ec", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2056bv64)) + LocalAssign(Register(R30, bv64) := 2016bv64) + ), + jumps( + DirectCall("1584:printf", condition()) + ) + ) + Block("2016:l00000430", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1584:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002da", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000485", condition()) + ) + ) + Block("1764:l00000485", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002da", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000498", condition()) + ) + ) + Block("1784:l000002da", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000498", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/function1/gcc_O2/function1-before-analysis.il.expected b/src/test/correct/function1/gcc_O2/function1-before-analysis.il.expected new file mode 100644 index 000000000..c5fc4e0e3 --- /dev/null +++ b/src/test/correct/function1/gcc_O2/function1-before-analysis.il.expected @@ -0,0 +1,340 @@ +Procedure("1552:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1980:l0000034f", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1944:l00000391", condition()) + ) + ) + Block("1944:l00000391", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1968:l0000039f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1956:l000003b8", condition()) + ) + ) + Block("1956:l000003b8", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1968bv64) + ), + jumps( + DirectCall("1552:__cxa_finalize", condition()) + ) + ) + Block("1968:l0000039f", + statements( + LocalAssign(Register(R30, bv64) := 1972bv64) + ), + jumps( + DirectCall("1808:deregister_tm_clones", condition()) + ) + ) + Block("1972:l000003ab", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1980:l0000034f", condition()) + ) + ) + Block("1980:l0000034f", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1568:__printf_chk", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2028:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2028:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1472:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1488bv64) + ), + jumps( + DirectCall("1780:call_weak_fn", condition()) + ) + ) + Block("1488:l00000565", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1536:__libc_start_main", condition()) + ) + ) + Block("1776:l00000279", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1600:abort", condition()) + ) + ) + Block("?:l0000060a", + statements( + ), + jumps( + DirectCall("1780:call_weak_fn", condition()) + ) + ) +)), +Procedure("1600:abort", in(), out(), blocks( +)), +Procedure("1780:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1780:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1796:l0000028f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1792:l00000408", condition()) + ) + ) + Block("1796:l0000028f", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1792:l00000408", + statements( + ), + jumps( + GoTo("1584:l__gmon_start__", condition()) + ) + ) + Block("1584:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1808:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1852:l000002d4", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1832:l000003ea", condition()) + ) + ) + Block("1832:l000003ea", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1852:l000002d4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1844:l000003fd", condition()) + ) + ) + Block("1852:l000002d4", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1844:l000003fd", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2000:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2000:lframe_dummy", + statements( + ), + jumps( + DirectCall("1856:register_tm_clones", condition()) + ) + ) +)), +Procedure("2016:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2016:lget_two", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R1, bv64)[32:0]), BinaryExpr("++", 0bv24, Extract(Register(R0, bv64)[8:0]))), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), Extract(Register(R2, bv64)[32:0])), 32)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1664:lmain", + statements( + LocalAssign(LocalVar(#1, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#1, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#1, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#1, bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R3, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R2, bv64) := 58475bv64) + LocalAssign(Register(R2, bv64) := ZeroExtend(BinaryExpr("++", 21515bv16, Extract(Register(R2, bv64)[16:0])), 32)) + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R1, bv64) := 0bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2056bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R3, bv64), 4bv64)] := Extract(Register(R2, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 1712bv64) + ), + jumps( + DirectCall("1568:__printf_chk", condition()) + ) + ) + Block("1712:l0000021a", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1856:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1912:l00000310", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1892:l000003cc", condition()) + ) + ) + Block("1892:l000003cc", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1912:l00000310", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1904:l000003df", condition()) + ) + ) + Block("1912:l00000310", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1904:l000003df", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/function1/gcc_no_plt_no_pic/function1-before-analysis.il.expected b/src/test/correct/function1/gcc_no_plt_no_pic/function1-before-analysis.il.expected new file mode 100644 index 000000000..c4ce73681 --- /dev/null +++ b/src/test/correct/function1/gcc_no_plt_no_pic/function1-before-analysis.il.expected @@ -0,0 +1,367 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l00000a71", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000ba2", condition()) + ) + ) + Block("1816:l00000ba2", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l00000bb0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000bc9", condition()) + ) + ) + Block("1828:l00000bc9", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000bb0", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000bbc", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l00000a71", condition()) + ) + ) + Block("1852:l00000a71", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2028:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2028:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1464:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1480bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1480:l00000de8", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l0000099b", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l00000e94", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l000009b1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000c19", condition()) + ) + ) + Block("1668:l000009b1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000c19", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l000009f6", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000bfb", condition()) + ) + ) + Block("1704:l00000bfb", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l000009f6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000c0e", condition()) + ) + ) + Block("1724:l000009f6", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000c0e", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:lget_two", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R1, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R2, bv64))) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1924:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1924:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R2, bv64) := 58368bv64) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:32]), BinaryExpr("++", 21515bv16, Extract(Register(R2, bv64)[16:0])))) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:48]), BinaryExpr("++", 2bv16, Extract(Register(R2, bv64)[32:0])))) + LocalAssign(Register(R1, bv64) := 10bv64) + LocalAssign(Register(R0, bv64) := 97bv64) + LocalAssign(Register(R30, bv64) := 1972bv64) + ), + jumps( + DirectCall("1876:get_two", condition()) + ) + ) + Block("1972:l00000b44", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2056bv64)) + LocalAssign(Register(R30, bv64) := 2016bv64) + ), + jumps( + DirectCall("1584:printf", condition()) + ) + ) + Block("2016:l00000b88", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1584:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000a32", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000bdd", condition()) + ) + ) + Block("1764:l00000bdd", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l00000a32", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000bf0", condition()) + ) + ) + Block("1784:l00000a32", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000bf0", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/function1/gcc_pic/function1-before-analysis.il.expected b/src/test/correct/function1/gcc_pic/function1-before-analysis.il.expected new file mode 100644 index 000000000..5b51e5cd9 --- /dev/null +++ b/src/test/correct/function1/gcc_pic/function1-before-analysis.il.expected @@ -0,0 +1,367 @@ +Procedure("1584:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1856:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1916:l00000319", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1880:l0000044d", condition()) + ) + ) + Block("1880:l0000044d", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1904:l0000045b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1892:l00000474", condition()) + ) + ) + Block("1892:l00000474", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1904bv64) + ), + jumps( + DirectCall("1584:__cxa_finalize", condition()) + ) + ) + Block("1904:l0000045b", + statements( + LocalAssign(Register(R30, bv64) := 1908bv64) + ), + jumps( + DirectCall("1744:deregister_tm_clones", condition()) + ) + ) + Block("1908:l00000467", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1916:l00000319", condition()) + ) + ) + Block("1916:l00000319", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1568:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1568:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2092:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2092:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1512:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1512:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1528bv64) + ), + jumps( + DirectCall("1716:call_weak_fn", condition()) + ) + ) + Block("1528:l00000621", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1712bv64) + ), + jumps( + DirectCall("1568:__libc_start_main", condition()) + ) + ) + Block("1712:l00000243", + statements( + LocalAssign(Register(R30, bv64) := 1716bv64) + ), + jumps( + DirectCall("1616:abort", condition()) + ) + ) + Block("?:l000006f4", + statements( + ), + jumps( + DirectCall("1716:call_weak_fn", condition()) + ) + ) +)), +Procedure("1616:abort", in(), out(), blocks( +)), +Procedure("1716:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1716:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1732:l00000259", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1728:l000004c4", condition()) + ) + ) + Block("1732:l00000259", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1728:l000004c4", + statements( + ), + jumps( + GoTo("1600:l__gmon_start__", condition()) + ) + ) + Block("1600:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1744:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1744:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1788:l0000029e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1768:l000004a6", condition()) + ) + ) + Block("1768:l000004a6", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) + ), + jumps( + GoTo("1788:l0000029e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1780:l000004b9", condition()) + ) + ) + Block("1788:l0000029e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1780:l000004b9", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1936:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1936:lframe_dummy", + statements( + ), + jumps( + DirectCall("1792:register_tm_clones", condition()) + ) + ) +)), +Procedure("1940:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1940:lget_two", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R1, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R2, bv64))) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1988:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1988:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R2, bv64) := 58368bv64) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:32]), BinaryExpr("++", 21515bv16, Extract(Register(R2, bv64)[16:0])))) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:48]), BinaryExpr("++", 2bv16, Extract(Register(R2, bv64)[32:0])))) + LocalAssign(Register(R1, bv64) := 10bv64) + LocalAssign(Register(R0, bv64) := 97bv64) + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1940:get_two", condition()) + ) + ) + Block("2036:l000003ed", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2120bv64)) + LocalAssign(Register(R30, bv64) := 2080bv64) + ), + jumps( + DirectCall("1632:printf", condition()) + ) + ) + Block("2080:l00000433", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1848:l000002da", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000488", condition()) + ) + ) + Block("1828:l00000488", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1848:l000002da", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1840:l0000049b", condition()) + ) + ) + Block("1848:l000002da", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1840:l0000049b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/functions_with_params/clang/functions_with_params-before-analysis.il.expected b/src/test/correct/functions_with_params/clang/functions_with_params-before-analysis.il.expected new file mode 100644 index 000000000..ef234d57e --- /dev/null +++ b/src/test/correct/functions_with_params/clang/functions_with_params-before-analysis.il.expected @@ -0,0 +1,339 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002d1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000038e", condition()) + ) + ) + Block("1752:l0000038e", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000039c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003b5", condition()) + ) + ) + Block("1764:l000003b5", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000039c", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000003a8", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002d1", condition()) + ) + ) + Block("1788:l000002d1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1892:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1892:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l0000059c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001fb", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000656", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000211", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000405", condition()) + ) + ) + Block("1604:l00000211", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000405", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003e7", condition()) + ) + ) + Block("1640:l000003e7", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003fa", condition()) + ) + ) + Block("1660:l00000256", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003fa", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)]), 32)) + LocalAssign(Register(R30, bv64) := 1848bv64) + ), + jumps( + DirectCall("1868:plus_one", condition()) + ) + ) + Block("1848:l00000366", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1868:plus_one", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1868:lplus_one", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003c9", condition()) + ) + ) + Block("1700:l000003c9", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003dc", condition()) + ) + ) + Block("1720:l00000292", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003dc", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/functions_with_params/clang_O2/functions_with_params-before-analysis.il.expected b/src/test/correct/functions_with_params/clang_O2/functions_with_params-before-analysis.il.expected new file mode 100644 index 000000000..7b0c03c4b --- /dev/null +++ b/src/test/correct/functions_with_params/clang_O2/functions_with_params-before-analysis.il.expected @@ -0,0 +1,312 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000291", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002cf", condition()) + ) + ) + Block("1752:l000002cf", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000002f6", condition()) + ) + ) + Block("1764:l000002f6", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002dd", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002e9", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000291", condition()) + ) + ) + Block("1788:l00000291", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1828:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1828:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004cd", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001bb", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000577", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000346", condition()) + ) + ) + Block("1604:l000001d1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000346", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000216", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000328", condition()) + ) + ) + Block("1640:l00000328", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000216", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000033b", condition()) + ) + ) + Block("1660:l00000216", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000033b", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1820:plus_one", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1820:lplus_one", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000030a", condition()) + ) + ) + Block("1700:l0000030a", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000031d", condition()) + ) + ) + Block("1720:l00000252", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000031d", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/functions_with_params/clang_no_plt_no_pic/functions_with_params-before-analysis.il.expected b/src/test/correct/functions_with_params/clang_no_plt_no_pic/functions_with_params-before-analysis.il.expected new file mode 100644 index 000000000..df1be07a9 --- /dev/null +++ b/src/test/correct/functions_with_params/clang_no_plt_no_pic/functions_with_params-before-analysis.il.expected @@ -0,0 +1,339 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000091c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000009d9", condition()) + ) + ) + Block("1752:l000009d9", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000009e7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000a00", condition()) + ) + ) + Block("1764:l00000a00", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000009e7", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009f3", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000091c", condition()) + ) + ) + Block("1788:l0000091c", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1892:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1892:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000be7", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000846", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c7d", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000085c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a50", condition()) + ) + ) + Block("1604:l0000085c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a50", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000008a1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000a32", condition()) + ) + ) + Block("1640:l00000a32", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l000008a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a45", condition()) + ) + ) + Block("1660:l000008a1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a45", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)]), 32)) + LocalAssign(Register(R30, bv64) := 1848bv64) + ), + jumps( + DirectCall("1868:plus_one", condition()) + ) + ) + Block("1848:l000009b1", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1868:plus_one", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1868:lplus_one", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000a14", condition()) + ) + ) + Block("1700:l00000a14", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000008dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000a27", condition()) + ) + ) + Block("1720:l000008dd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000a27", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/functions_with_params/clang_pic/functions_with_params-before-analysis.il.expected b/src/test/correct/functions_with_params/clang_pic/functions_with_params-before-analysis.il.expected new file mode 100644 index 000000000..df1be07a9 --- /dev/null +++ b/src/test/correct/functions_with_params/clang_pic/functions_with_params-before-analysis.il.expected @@ -0,0 +1,339 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000091c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000009d9", condition()) + ) + ) + Block("1752:l000009d9", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000009e7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000a00", condition()) + ) + ) + Block("1764:l00000a00", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000009e7", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009f3", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000091c", condition()) + ) + ) + Block("1788:l0000091c", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1892:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1892:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000be7", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000846", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c7d", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000085c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a50", condition()) + ) + ) + Block("1604:l0000085c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a50", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000008a1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000a32", condition()) + ) + ) + Block("1640:l00000a32", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l000008a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a45", condition()) + ) + ) + Block("1660:l000008a1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a45", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)]), 32)) + LocalAssign(Register(R30, bv64) := 1848bv64) + ), + jumps( + DirectCall("1868:plus_one", condition()) + ) + ) + Block("1848:l000009b1", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1868:plus_one", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1868:lplus_one", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000a14", condition()) + ) + ) + Block("1700:l00000a14", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000008dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000a27", condition()) + ) + ) + Block("1720:l000008dd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000a27", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/functions_with_params/gcc/functions_with_params-before-analysis.il.expected b/src/test/correct/functions_with_params/gcc/functions_with_params-before-analysis.il.expected new file mode 100644 index 000000000..e5efd9aa7 --- /dev/null +++ b/src/test/correct/functions_with_params/gcc/functions_with_params-before-analysis.il.expected @@ -0,0 +1,338 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002c9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000037e", condition()) + ) + ) + Block("1752:l0000037e", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l0000038c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003a5", condition()) + ) + ) + Block("1764:l000003a5", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000038c", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000398", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002c9", condition()) + ) + ) + Block("1788:l000002c9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1884:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1884:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l0000058a", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001f3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000642", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000209", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003f5", condition()) + ) + ) + Block("1604:l00000209", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003f5", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003d7", condition()) + ) + ) + Block("1640:l000003d7", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003ea", condition()) + ) + ) + Block("1660:l0000024e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003ea", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1860:plus_one", condition()) + ) + ) + Block("1844:l0000035c", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1860:plus_one", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1860:lplus_one", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003b9", condition()) + ) + ) + Block("1700:l000003b9", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003cc", condition()) + ) + ) + Block("1720:l0000028a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003cc", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/functions_with_params/gcc_O2/functions_with_params-before-analysis.il.expected b/src/test/correct/functions_with_params/gcc_O2/functions_with_params-before-analysis.il.expected new file mode 100644 index 000000000..4ed2e878f --- /dev/null +++ b/src/test/correct/functions_with_params/gcc_O2/functions_with_params-before-analysis.il.expected @@ -0,0 +1,312 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002fb", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000335", condition()) + ) + ) + Block("1816:l00000335", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l00000343", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000035c", condition()) + ) + ) + Block("1828:l0000035c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000343", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000034f", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002fb", condition()) + ) + ) + Block("1852:l000002fb", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1896:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l00000544", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000225", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005ff", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l0000023b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003ac", condition()) + ) + ) + Block("1668:l0000023b", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003ac", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000280", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000038e", condition()) + ) + ) + Block("1704:l0000038e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000280", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003a1", condition()) + ) + ) + Block("1724:l00000280", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003a1", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1888:plus_one", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1888:lplus_one", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002bc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000370", condition()) + ) + ) + Block("1764:l00000370", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002bc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000383", condition()) + ) + ) + Block("1784:l000002bc", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000383", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/functions_with_params/gcc_no_plt_no_pic/functions_with_params-before-analysis.il.expected b/src/test/correct/functions_with_params/gcc_no_plt_no_pic/functions_with_params-before-analysis.il.expected new file mode 100644 index 000000000..67f60a718 --- /dev/null +++ b/src/test/correct/functions_with_params/gcc_no_plt_no_pic/functions_with_params-before-analysis.il.expected @@ -0,0 +1,338 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000900", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000009b5", condition()) + ) + ) + Block("1752:l000009b5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000009c3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009dc", condition()) + ) + ) + Block("1764:l000009dc", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000009c3", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009cf", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000900", condition()) + ) + ) + Block("1788:l00000900", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1884:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1884:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000bc1", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000082a", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c55", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000840", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a2c", condition()) + ) + ) + Block("1604:l00000840", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a2c", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000885", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000a0e", condition()) + ) + ) + Block("1640:l00000a0e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000885", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a21", condition()) + ) + ) + Block("1660:l00000885", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a21", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1860:plus_one", condition()) + ) + ) + Block("1844:l00000993", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1860:plus_one", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1860:lplus_one", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009f0", condition()) + ) + ) + Block("1700:l000009f0", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000008c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000a03", condition()) + ) + ) + Block("1720:l000008c1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000a03", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/functions_with_params/gcc_pic/functions_with_params-before-analysis.il.expected b/src/test/correct/functions_with_params/gcc_pic/functions_with_params-before-analysis.il.expected new file mode 100644 index 000000000..67f60a718 --- /dev/null +++ b/src/test/correct/functions_with_params/gcc_pic/functions_with_params-before-analysis.il.expected @@ -0,0 +1,338 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000900", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000009b5", condition()) + ) + ) + Block("1752:l000009b5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000009c3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009dc", condition()) + ) + ) + Block("1764:l000009dc", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000009c3", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009cf", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000900", condition()) + ) + ) + Block("1788:l00000900", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1884:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1884:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000bc1", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000082a", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c55", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000840", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a2c", condition()) + ) + ) + Block("1604:l00000840", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a2c", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000885", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000a0e", condition()) + ) + ) + Block("1640:l00000a0e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000885", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a21", condition()) + ) + ) + Block("1660:l00000885", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a21", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1860:plus_one", condition()) + ) + ) + Block("1844:l00000993", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1860:plus_one", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1860:lplus_one", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009f0", condition()) + ) + ) + Block("1700:l000009f0", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000008c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000a03", condition()) + ) + ) + Block("1720:l000008c1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000a03", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/ifbranches/clang/ifbranches-before-analysis.il.expected b/src/test/correct/ifbranches/clang/ifbranches-before-analysis.il.expected new file mode 100644 index 000000000..e2f0a8894 --- /dev/null +++ b/src/test/correct/ifbranches/clang/ifbranches-before-analysis.il.expected @@ -0,0 +1,375 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002d9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000003ac", condition()) + ) + ) + Block("1752:l000003ac", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000003ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003d3", condition()) + ) + ) + Block("1764:l000003d3", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000003ba", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000003c6", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002d9", condition()) + ) + ) + Block("1788:l000002d9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1900:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000005bc", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000203", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000677", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000219", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000423", condition()) + ) + ) + Block("1604:l00000219", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000423", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000405", condition()) + ) + ) + Block("1640:l00000405", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000418", condition()) + ) + ) + Block("1660:l0000025e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000418", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l0000034c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l0000034f", condition()) + ) + ) + Block("?:l0000034f", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000352", condition()) + ) + ) + Block("?:l0000034c", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000352", condition()) + ) + ) + Block("?:l00000352", + statements( + ), + jumps( + GoTo("1864:l0000035a", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1848:l00000397", condition()) + ) + ) + Block("1864:l0000035a", + statements( + LocalAssign(Register(R8, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1876:l0000036d", condition()) + ) + ) + Block("1848:l00000397", + statements( + ), + jumps( + GoTo("1852:l00000398", condition()) + ) + ) + Block("1852:l00000398", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1876:l0000036d", condition()) + ) + ) + Block("1876:l0000036d", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000029a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003e7", condition()) + ) + ) + Block("1700:l000003e7", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000029a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003fa", condition()) + ) + ) + Block("1720:l0000029a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003fa", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/ifbranches/clang_O2/ifbranches-before-analysis.il.expected b/src/test/correct/ifbranches/clang_O2/ifbranches-before-analysis.il.expected new file mode 100644 index 000000000..f04cfa835 --- /dev/null +++ b/src/test/correct/ifbranches/clang_O2/ifbranches-before-analysis.il.expected @@ -0,0 +1,331 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000291", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002ed", condition()) + ) + ) + Block("1752:l000002ed", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002fb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000314", condition()) + ) + ) + Block("1764:l00000314", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002fb", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000307", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000291", condition()) + ) + ) + Block("1788:l00000291", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1828:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1828:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004eb", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001bb", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000593", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000364", condition()) + ) + ) + Block("1604:l000001d1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000364", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000216", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000346", condition()) + ) + ) + Block("1640:l00000346", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000216", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000359", condition()) + ) + ) + Block("1660:l00000216", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000359", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 2bv64) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("?:l000002db", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l000002df", condition()) + ) + ) + Block("?:l000002df", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + ), + jumps( + GoTo("?:l000002e2", condition()) + ) + ) + Block("?:l000002db", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(Extract(Register(R8, bv64)[32:0]), 32)) + ), + jumps( + GoTo("?:l000002e2", condition()) + ) + ) + Block("?:l000002e2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000328", condition()) + ) + ) + Block("1700:l00000328", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000033b", condition()) + ) + ) + Block("1720:l00000252", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000033b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/ifbranches/clang_no_plt_no_pic/ifbranches-before-analysis.il.expected b/src/test/correct/ifbranches/clang_no_plt_no_pic/ifbranches-before-analysis.il.expected new file mode 100644 index 000000000..00d66effe --- /dev/null +++ b/src/test/correct/ifbranches/clang_no_plt_no_pic/ifbranches-before-analysis.il.expected @@ -0,0 +1,375 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000945", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000a18", condition()) + ) + ) + Block("1752:l00000a18", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000a26", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000a3f", condition()) + ) + ) + Block("1764:l00000a3f", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000a26", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000a32", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000945", condition()) + ) + ) + Block("1788:l00000945", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1900:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000c28", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000086f", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000cc0", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000885", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a8f", condition()) + ) + ) + Block("1604:l00000885", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a8f", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000008ca", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000a71", condition()) + ) + ) + Block("1640:l00000a71", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l000008ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a84", condition()) + ) + ) + Block("1660:l000008ca", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a84", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l000009b8", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l000009bb", condition()) + ) + ) + Block("?:l000009bb", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l000009be", condition()) + ) + ) + Block("?:l000009b8", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l000009be", condition()) + ) + ) + Block("?:l000009be", + statements( + ), + jumps( + GoTo("1864:l000009c6", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1848:l00000a03", condition()) + ) + ) + Block("1864:l000009c6", + statements( + LocalAssign(Register(R8, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1876:l000009d9", condition()) + ) + ) + Block("1848:l00000a03", + statements( + ), + jumps( + GoTo("1852:l00000a04", condition()) + ) + ) + Block("1852:l00000a04", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1876:l000009d9", condition()) + ) + ) + Block("1876:l000009d9", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000906", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000a53", condition()) + ) + ) + Block("1700:l00000a53", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000906", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000a66", condition()) + ) + ) + Block("1720:l00000906", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000a66", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/ifbranches/clang_pic/ifbranches-before-analysis.il.expected b/src/test/correct/ifbranches/clang_pic/ifbranches-before-analysis.il.expected new file mode 100644 index 000000000..00d66effe --- /dev/null +++ b/src/test/correct/ifbranches/clang_pic/ifbranches-before-analysis.il.expected @@ -0,0 +1,375 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000945", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000a18", condition()) + ) + ) + Block("1752:l00000a18", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000a26", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000a3f", condition()) + ) + ) + Block("1764:l00000a3f", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000a26", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000a32", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000945", condition()) + ) + ) + Block("1788:l00000945", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1900:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000c28", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000086f", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000cc0", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000885", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a8f", condition()) + ) + ) + Block("1604:l00000885", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a8f", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000008ca", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000a71", condition()) + ) + ) + Block("1640:l00000a71", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l000008ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a84", condition()) + ) + ) + Block("1660:l000008ca", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a84", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l000009b8", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l000009bb", condition()) + ) + ) + Block("?:l000009bb", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l000009be", condition()) + ) + ) + Block("?:l000009b8", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l000009be", condition()) + ) + ) + Block("?:l000009be", + statements( + ), + jumps( + GoTo("1864:l000009c6", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1848:l00000a03", condition()) + ) + ) + Block("1864:l000009c6", + statements( + LocalAssign(Register(R8, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1876:l000009d9", condition()) + ) + ) + Block("1848:l00000a03", + statements( + ), + jumps( + GoTo("1852:l00000a04", condition()) + ) + ) + Block("1852:l00000a04", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1876:l000009d9", condition()) + ) + ) + Block("1876:l000009d9", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000906", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000a53", condition()) + ) + ) + Block("1700:l00000a53", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000906", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000a66", condition()) + ) + ) + Block("1720:l00000906", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000a66", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/ifbranches/gcc/ifbranches-before-analysis.il.expected b/src/test/correct/ifbranches/gcc/ifbranches-before-analysis.il.expected new file mode 100644 index 000000000..f575f8a04 --- /dev/null +++ b/src/test/correct/ifbranches/gcc/ifbranches-before-analysis.il.expected @@ -0,0 +1,342 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002c9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000037a", condition()) + ) + ) + Block("1752:l0000037a", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000388", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003a1", condition()) + ) + ) + Block("1764:l000003a1", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000388", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000394", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002c9", condition()) + ) + ) + Block("1788:l000002c9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1884:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1884:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000586", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001f3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000063e", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000209", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003f1", condition()) + ) + ) + Block("1604:l00000209", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003f1", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003d3", condition()) + ) + ) + Block("1640:l000003d3", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003e6", condition()) + ) + ) + Block("1660:l0000024e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003e6", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R1, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1852:l00000330", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1840:l00000369", condition()) + ) + ) + Block("1852:l00000330", + statements( + LocalAssign(Register(R0, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1860:l00000342", condition()) + ) + ) + Block("1840:l00000369", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1860:l00000342", condition()) + ) + ) + Block("1860:l00000342", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003b5", condition()) + ) + ) + Block("1700:l000003b5", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003c8", condition()) + ) + ) + Block("1720:l0000028a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003c8", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/ifbranches/gcc_O2/ifbranches-before-analysis.il.expected b/src/test/correct/ifbranches/gcc_O2/ifbranches-before-analysis.il.expected new file mode 100644 index 000000000..6b815666b --- /dev/null +++ b/src/test/correct/ifbranches/gcc_O2/ifbranches-before-analysis.il.expected @@ -0,0 +1,331 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l0000030b", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000334", condition()) + ) + ) + Block("1816:l00000334", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l00000342", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000035b", condition()) + ) + ) + Block("1828:l0000035b", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000342", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000034e", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l0000030b", condition()) + ) + ) + Block("1852:l0000030b", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l0000053e", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000235", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005f2", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l0000024b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003ab", condition()) + ) + ) + Block("1668:l0000024b", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003ab", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000290", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000038d", condition()) + ) + ) + Block("1704:l0000038d", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000290", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003a0", condition()) + ) + ) + Block("1724:l00000290", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003a0", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(LocalVar(#1, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#1, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#1, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#1, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#1, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("?:l000001c3", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l000001c6", condition()) + ) + ) + Block("?:l000001c6", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + ), + jumps( + GoTo("?:l000001c9", condition()) + ) + ) + Block("?:l000001c3", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + GoTo("?:l000001c9", condition()) + ) + ) + Block("?:l000001c9", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 2bv32), 32)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002cc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000036f", condition()) + ) + ) + Block("1764:l0000036f", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002cc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000382", condition()) + ) + ) + Block("1784:l000002cc", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000382", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/ifbranches/gcc_no_plt_no_pic/ifbranches-before-analysis.il.expected b/src/test/correct/ifbranches/gcc_no_plt_no_pic/ifbranches-before-analysis.il.expected new file mode 100644 index 000000000..ac9ccda29 --- /dev/null +++ b/src/test/correct/ifbranches/gcc_no_plt_no_pic/ifbranches-before-analysis.il.expected @@ -0,0 +1,342 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008fc", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000009ad", condition()) + ) + ) + Block("1752:l000009ad", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000009bb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009d4", condition()) + ) + ) + Block("1764:l000009d4", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000009bb", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009c7", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008fc", condition()) + ) + ) + Block("1788:l000008fc", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1884:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1884:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000bb9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000826", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c4d", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l0000083c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a24", condition()) + ) + ) + Block("1604:l0000083c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a24", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000881", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000a06", condition()) + ) + ) + Block("1640:l00000a06", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000881", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a19", condition()) + ) + ) + Block("1660:l00000881", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a19", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R1, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1852:l00000963", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1840:l0000099c", condition()) + ) + ) + Block("1852:l00000963", + statements( + LocalAssign(Register(R0, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1860:l00000975", condition()) + ) + ) + Block("1840:l0000099c", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1860:l00000975", condition()) + ) + ) + Block("1860:l00000975", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009e8", condition()) + ) + ) + Block("1700:l000009e8", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000008bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009fb", condition()) + ) + ) + Block("1720:l000008bd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009fb", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/ifbranches/gcc_pic/ifbranches-before-analysis.il.expected b/src/test/correct/ifbranches/gcc_pic/ifbranches-before-analysis.il.expected new file mode 100644 index 000000000..ac9ccda29 --- /dev/null +++ b/src/test/correct/ifbranches/gcc_pic/ifbranches-before-analysis.il.expected @@ -0,0 +1,342 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008fc", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000009ad", condition()) + ) + ) + Block("1752:l000009ad", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000009bb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009d4", condition()) + ) + ) + Block("1764:l000009d4", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000009bb", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009c7", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008fc", condition()) + ) + ) + Block("1788:l000008fc", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1884:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1884:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000bb9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000826", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c4d", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l0000083c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a24", condition()) + ) + ) + Block("1604:l0000083c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a24", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000881", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000a06", condition()) + ) + ) + Block("1640:l00000a06", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000881", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a19", condition()) + ) + ) + Block("1660:l00000881", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a19", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R1, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1852:l00000963", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1840:l0000099c", condition()) + ) + ) + Block("1852:l00000963", + statements( + LocalAssign(Register(R0, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1860:l00000975", condition()) + ) + ) + Block("1840:l0000099c", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1860:l00000975", condition()) + ) + ) + Block("1860:l00000975", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009e8", condition()) + ) + ) + Block("1700:l000009e8", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000008bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009fb", condition()) + ) + ) + Block("1720:l000008bd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009fb", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/ifglobal/clang/ifglobal-before-analysis.il.expected b/src/test/correct/ifglobal/clang/ifglobal-before-analysis.il.expected new file mode 100644 index 000000000..4039fb15c --- /dev/null +++ b/src/test/correct/ifglobal/clang/ifglobal-before-analysis.il.expected @@ -0,0 +1,362 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000035d", condition()) + ) + ) + Block("1752:l0000035d", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000036b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000384", condition()) + ) + ) + Block("1764:l00000384", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000036b", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000377", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002bd", condition()) + ) + ) + Block("1788:l000002bd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000566", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001e7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000061a", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003d4", condition()) + ) + ) + Block("1604:l000001fd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003d4", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003b6", condition()) + ) + ) + Block("1640:l000003b6", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003c9", condition()) + ) + ) + Block("1660:l00000242", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003c9", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l0000031e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000321", condition()) + ) + ) + Block("?:l00000321", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000324", condition()) + ) + ) + Block("?:l0000031e", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000324", condition()) + ) + ) + Block("?:l00000324", + statements( + ), + jumps( + GoTo("1860:l0000032c", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1840:l00000343", condition()) + ) + ) + Block("1840:l00000343", + statements( + ), + jumps( + GoTo("1844:l00000344", condition()) + ) + ) + Block("1844:l00000344", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + LocalAssign(Register(R9, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1860:l0000032c", condition()) + ) + ) + Block("1860:l0000032c", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000398", condition()) + ) + ) + Block("1700:l00000398", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003ab", condition()) + ) + ) + Block("1720:l0000027e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003ab", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/ifglobal/clang_O2/ifglobal-before-analysis.il.expected b/src/test/correct/ifglobal/clang_O2/ifglobal-before-analysis.il.expected new file mode 100644 index 000000000..5c9edb780 --- /dev/null +++ b/src/test/correct/ifglobal/clang_O2/ifglobal-before-analysis.il.expected @@ -0,0 +1,322 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000302", condition()) + ) + ) + Block("1752:l00000302", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000310", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000329", condition()) + ) + ) + Block("1764:l00000329", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000310", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000031c", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002a5", condition()) + ) + ) + Block("1788:l000002a5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1848:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000505", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001cf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005b3", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000379", condition()) + ) + ) + Block("1604:l000001e5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000379", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000035b", condition()) + ) + ) + Block("1640:l0000035b", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000036e", condition()) + ) + ) + Block("1660:l0000022a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000036e", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + ), + jumps( + GoTo("1832:l000002dc", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R9, bv64)[32:0]), 0bv32), 0bv1))) + GoTo("1824:l000002f8", condition()) + ) + ) + Block("1832:l000002dc", + statements( + LocalAssign(Register(R9, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1824:l000002f8", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000033d", condition()) + ) + ) + Block("1700:l0000033d", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000350", condition()) + ) + ) + Block("1720:l00000266", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000350", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/ifglobal/clang_no_plt_no_pic/ifglobal-before-analysis.il.expected b/src/test/correct/ifglobal/clang_no_plt_no_pic/ifglobal-before-analysis.il.expected new file mode 100644 index 000000000..46c9031d0 --- /dev/null +++ b/src/test/correct/ifglobal/clang_no_plt_no_pic/ifglobal-before-analysis.il.expected @@ -0,0 +1,362 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008cc", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000096c", condition()) + ) + ) + Block("1752:l0000096c", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000097a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000993", condition()) + ) + ) + Block("1764:l00000993", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000097a", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000986", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008cc", condition()) + ) + ) + Block("1788:l000008cc", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b75", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007f6", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c06", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000080c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000009e3", condition()) + ) + ) + Block("1604:l0000080c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000009e3", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000851", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009c5", condition()) + ) + ) + Block("1640:l000009c5", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000851", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009d8", condition()) + ) + ) + Block("1660:l00000851", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009d8", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l0000092d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000930", condition()) + ) + ) + Block("?:l00000930", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000933", condition()) + ) + ) + Block("?:l0000092d", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000933", condition()) + ) + ) + Block("?:l00000933", + statements( + ), + jumps( + GoTo("1860:l0000093b", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1840:l00000952", condition()) + ) + ) + Block("1840:l00000952", + statements( + ), + jumps( + GoTo("1844:l00000953", condition()) + ) + ) + Block("1844:l00000953", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + LocalAssign(Register(R9, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1860:l0000093b", condition()) + ) + ) + Block("1860:l0000093b", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000088d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009a7", condition()) + ) + ) + Block("1700:l000009a7", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000088d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009ba", condition()) + ) + ) + Block("1720:l0000088d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009ba", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/ifglobal/clang_pic/ifglobal-before-analysis.il.expected b/src/test/correct/ifglobal/clang_pic/ifglobal-before-analysis.il.expected new file mode 100644 index 000000000..0e64742de --- /dev/null +++ b/src/test/correct/ifglobal/clang_pic/ifglobal-before-analysis.il.expected @@ -0,0 +1,364 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000373", condition()) + ) + ) + Block("1816:l00000373", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) + ), + jumps( + GoTo("1840:l00000381", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000039a", condition()) + ) + ) + Block("1828:l0000039a", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000381", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000038d", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002c5", condition()) + ) + ) + Block("1852:l000002c5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1944:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l00000521", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001ef", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l000005d7", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003ea", condition()) + ) + ) + Block("1668:l00000205", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003ea", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003cc", condition()) + ) + ) + Block("1704:l000003cc", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003df", condition()) + ) + ) + Block("1724:l0000024a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003df", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4040bv64)])) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l0000032d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000330", condition()) + ) + ) + Block("?:l00000330", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000333", condition()) + ) + ) + Block("?:l0000032d", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000333", condition()) + ) + ) + Block("?:l00000333", + statements( + ), + jumps( + GoTo("1932:l0000033b", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1908:l00000352", condition()) + ) + ) + Block("1908:l00000352", + statements( + ), + jumps( + GoTo("1912:l00000353", condition()) + ) + ) + Block("1912:l00000353", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4040bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1932:l0000033b", condition()) + ) + ) + Block("1932:l0000033b", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003ae", condition()) + ) + ) + Block("1764:l000003ae", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003c1", condition()) + ) + ) + Block("1784:l00000286", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003c1", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/ifglobal/gcc/ifglobal-before-analysis.il.expected b/src/test/correct/ifglobal/gcc/ifglobal-before-analysis.il.expected new file mode 100644 index 000000000..bd34f224b --- /dev/null +++ b/src/test/correct/ifglobal/gcc/ifglobal-before-analysis.il.expected @@ -0,0 +1,329 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002ad", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000329", condition()) + ) + ) + Block("1752:l00000329", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000337", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000350", condition()) + ) + ) + Block("1764:l00000350", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000337", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000343", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002ad", condition()) + ) + ) + Block("1788:l000002ad", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1856:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l0000052e", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001d7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005df", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000001ed", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003a0", condition()) + ) + ) + Block("1604:l000001ed", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003a0", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000232", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000382", condition()) + ) + ) + Block("1640:l00000382", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000232", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000395", condition()) + ) + ) + Block("1660:l00000232", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000395", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1848:l00000302", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1832:l00000311", condition()) + ) + ) + Block("1832:l00000311", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + GoTo("1848:l00000302", condition()) + ) + ) + Block("1848:l00000302", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000026e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000364", condition()) + ) + ) + Block("1700:l00000364", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000026e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000377", condition()) + ) + ) + Block("1720:l0000026e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000377", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/ifglobal/gcc_O2/ifglobal-before-analysis.il.expected b/src/test/correct/ifglobal/gcc_O2/ifglobal-before-analysis.il.expected new file mode 100644 index 000000000..65402983e --- /dev/null +++ b/src/test/correct/ifglobal/gcc_O2/ifglobal-before-analysis.il.expected @@ -0,0 +1,321 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000031a", condition()) + ) + ) + Block("1816:l0000031a", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l00000328", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000341", condition()) + ) + ) + Block("1828:l00000341", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000328", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000334", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f1", condition()) + ) + ) + Block("1852:l000002f1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l00000531", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l0000021b", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005e7", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000231", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000391", condition()) + ) + ) + Block("1668:l00000231", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000391", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000373", condition()) + ) + ) + Block("1704:l00000373", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000386", condition()) + ) + ) + Block("1724:l00000276", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000386", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 20bv64)]), 32)) + ), + jumps( + GoTo("1556:l000001b7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R1, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1548:l00000396", condition()) + ) + ) + Block("1548:l00000396", + statements( + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R0, bv64), 20bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + GoTo("1556:l000001b7", condition()) + ) + ) + Block("1556:l000001b7", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002b2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000355", condition()) + ) + ) + Block("1764:l00000355", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002b2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000368", condition()) + ) + ) + Block("1784:l000002b2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000368", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/ifglobal/gcc_no_plt_no_pic/ifglobal-before-analysis.il.expected b/src/test/correct/ifglobal/gcc_no_plt_no_pic/ifglobal-before-analysis.il.expected new file mode 100644 index 000000000..d10b07697 --- /dev/null +++ b/src/test/correct/ifglobal/gcc_no_plt_no_pic/ifglobal-before-analysis.il.expected @@ -0,0 +1,329 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000881", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000008fd", condition()) + ) + ) + Block("1752:l000008fd", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l0000090b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000924", condition()) + ) + ) + Block("1764:l00000924", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000090b", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000917", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000881", condition()) + ) + ) + Block("1788:l00000881", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1856:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b02", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007ab", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000b8f", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000007c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000974", condition()) + ) + ) + Block("1604:l000007c1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000974", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000806", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000956", condition()) + ) + ) + Block("1640:l00000956", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000806", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000969", condition()) + ) + ) + Block("1660:l00000806", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000969", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1848:l000008d6", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1832:l000008e5", condition()) + ) + ) + Block("1832:l000008e5", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + GoTo("1848:l000008d6", condition()) + ) + ) + Block("1848:l000008d6", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000842", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000938", condition()) + ) + ) + Block("1700:l00000938", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000842", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000094b", condition()) + ) + ) + Block("1720:l00000842", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000094b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/ifglobal/gcc_pic/ifglobal-before-analysis.il.expected b/src/test/correct/ifglobal/gcc_pic/ifglobal-before-analysis.il.expected new file mode 100644 index 000000000..d4ea5a415 --- /dev/null +++ b/src/test/correct/ifglobal/gcc_pic/ifglobal-before-analysis.il.expected @@ -0,0 +1,329 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002ad", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000032b", condition()) + ) + ) + Block("1816:l0000032b", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + ), + jumps( + GoTo("1840:l00000339", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000352", condition()) + ) + ) + Block("1828:l00000352", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000339", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000345", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002ad", condition()) + ) + ) + Block("1852:l000002ad", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1920:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l000004d9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001d7", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l0000058a", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l000001ed", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003a2", condition()) + ) + ) + Block("1668:l000001ed", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003a2", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000232", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000384", condition()) + ) + ) + Block("1704:l00000384", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) + ), + jumps( + GoTo("1724:l00000232", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000397", condition()) + ) + ) + Block("1724:l00000232", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000397", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1912:l00000303", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1896:l00000312", condition()) + ) + ) + Block("1896:l00000312", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + GoTo("1912:l00000303", condition()) + ) + ) + Block("1912:l00000303", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000026e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000366", condition()) + ) + ) + Block("1764:l00000366", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l0000026e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000379", condition()) + ) + ) + Block("1784:l0000026e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000379", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/indirect_call/clang_O2/indirect_call-before-analysis.il.expected b/src/test/correct/indirect_call/clang_O2/indirect_call-before-analysis.il.expected new file mode 100644 index 000000000..23a148a79 --- /dev/null +++ b/src/test/correct/indirect_call/clang_O2/indirect_call-before-analysis.il.expected @@ -0,0 +1,343 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002b9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000034c", condition()) + ) + ) + Block("1816:l0000034c", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1840:l0000035a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000373", condition()) + ) + ) + Block("1828:l00000373", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000035a", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000366", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002b9", condition()) + ) + ) + Block("1852:l000002b9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1932:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1932:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1464:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1480bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1480:l0000057a", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001e3", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l00000635", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l000001f9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003c3", condition()) + ) + ) + Block("1668:l000001f9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003c3", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003a5", condition()) + ) + ) + Block("1704:l000003a5", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1724:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003b8", condition()) + ) + ) + Block("1724:l0000023e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003b8", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:greet", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:lgreet", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1956bv64)) + ), + jumps( + DirectCall("1584:puts", condition()) + ) + ) +)), +Procedure("1888:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1888:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1970bv64)) + LocalAssign(Register(R30, bv64) := 1908bv64) + ), + jumps( + DirectCall("1584:puts", condition()) + ) + ) + Block("1908:l00000320", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1956bv64)) + LocalAssign(Register(R30, bv64) := 1920bv64) + ), + jumps( + DirectCall("1584:puts", condition()) + ) + ) + Block("1920:l00000332", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1584:puts", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000387", condition()) + ) + ) + Block("1764:l00000387", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000039a", condition()) + ) + ) + Block("1784:l0000027a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000039a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/indirect_call/gcc_O2/indirect_call-before-analysis.il.expected b/src/test/correct/indirect_call/gcc_O2/indirect_call-before-analysis.il.expected new file mode 100644 index 000000000..21702696f --- /dev/null +++ b/src/test/correct/indirect_call/gcc_O2/indirect_call-before-analysis.il.expected @@ -0,0 +1,341 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1856:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1916:l00000346", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1880:l00000375", condition()) + ) + ) + Block("1880:l00000375", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1904:l00000383", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1892:l0000039c", condition()) + ) + ) + Block("1892:l0000039c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1904bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1904:l00000383", + statements( + LocalAssign(Register(R30, bv64) := 1908bv64) + ), + jumps( + DirectCall("1744:deregister_tm_clones", condition()) + ) + ) + Block("1908:l0000038f", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1916:l00000346", condition()) + ) + ) + Block("1916:l00000346", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1964:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1964:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1464:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1480bv64) + ), + jumps( + DirectCall("1716:call_weak_fn", condition()) + ) + ) + Block("1480:l000005ab", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1712bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1712:l00000270", + statements( + LocalAssign(Register(R30, bv64) := 1716bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l0000066e", + statements( + ), + jumps( + DirectCall("1716:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1716:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1716:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1732:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1728:l000003ec", condition()) + ) + ) + Block("1732:l00000286", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1728:l000003ec", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1744:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1744:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1788:l000002cb", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1768:l000003ce", condition()) + ) + ) + Block("1768:l000003ce", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1788:l000002cb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1780:l000003e1", condition()) + ) + ) + Block("1788:l000002cb", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1780:l000003e1", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1936:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1936:lframe_dummy", + statements( + ), + jumps( + DirectCall("1792:register_tm_clones", condition()) + ) + ) +)), +Procedure("1952:greet", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1952:lgreet", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1992bv64)) + ), + jumps( + DirectCall("1584:puts", condition()) + ) + ) +)), +Procedure("1600:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1600:lmain", + statements( + LocalAssign(LocalVar(#1, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#1, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#1, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#1, bv64)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2008bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1620bv64) + ), + jumps( + DirectCall("1584:puts", condition()) + ) + ) + Block("1620:l000001ef", + statements( + LocalAssign(Register(R30, bv64) := 1624bv64) + ), + jumps( + DirectCall("1952:greet", condition()) + ) + ) + Block("1624:l00000205", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1584:puts", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1848:l00000307", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1828:l000003b0", condition()) + ) + ) + Block("1828:l000003b0", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1848:l00000307", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1840:l000003c3", condition()) + ) + ) + Block("1848:l00000307", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1840:l000003c3", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/initialisation/clang/initialisation-before-analysis.il.expected b/src/test/correct/initialisation/clang/initialisation-before-analysis.il.expected new file mode 100644 index 000000000..a5fe752a6 --- /dev/null +++ b/src/test/correct/initialisation/clang/initialisation-before-analysis.il.expected @@ -0,0 +1,325 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002d1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000038d", condition()) + ) + ) + Block("1752:l0000038d", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000039b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003b4", condition()) + ) + ) + Block("1764:l000003b4", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000039b", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000003a7", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002d1", condition()) + ) + ) + Block("1788:l000002d1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1892:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1892:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l0000059b", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001fb", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000653", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000211", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000404", condition()) + ) + ) + Block("1604:l00000211", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000404", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003e6", condition()) + ) + ) + Block("1640:l000003e6", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003f9", condition()) + ) + ) + Block("1660:l00000256", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003f9", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := BinaryExpr("add", Register(R9, bv64), 64bv64)) + LocalAssign(Register(R11, bv64) := 69632bv64) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R11, bv64), 48bv64)]), 32)) + LocalAssign(Register(R10, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R10, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R11, bv64), 48bv64)] := Extract(Register(R10, bv64)[32:0]))) + LocalAssign(Register(R11, bv64) := 69632bv64) + LocalAssign(Register(R10, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R11, bv64), 56bv64)])) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R10, bv64), 18446744073709551614bv64)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv64), 1bv64), 1), BinaryExpr("add", SignExtend(Register(R10, bv64), 1), 36893488147419103231bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv64), 1bv64), 1), BinaryExpr("add", ZeroExtend(Register(R10, bv64), 1), 18446744073709551615bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv64), 1bv64)[64:63])) + LocalAssign(Register(R10, bv64) := BinaryExpr("add", LocalVar(#4, bv64), 1bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R11, bv64), 56bv64)] := Register(R10, bv64))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 64bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 3bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 56)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003c8", condition()) + ) + ) + Block("1700:l000003c8", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003db", condition()) + ) + ) + Block("1720:l00000292", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003db", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/initialisation/clang_O2/initialisation-before-analysis.il.expected b/src/test/correct/initialisation/clang_O2/initialisation-before-analysis.il.expected new file mode 100644 index 000000000..820595de8 --- /dev/null +++ b/src/test/correct/initialisation/clang_O2/initialisation-before-analysis.il.expected @@ -0,0 +1,319 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002cd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000036e", condition()) + ) + ) + Block("1752:l0000036e", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000037c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000395", condition()) + ) + ) + Block("1764:l00000395", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000037c", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000388", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002cd", condition()) + ) + ) + Block("1788:l000002cd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1888:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1888:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l0000057b", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001f7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000632", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000020d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003e5", condition()) + ) + ) + Block("1604:l0000020d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003e5", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003c7", condition()) + ) + ) + Block("1640:l000003c7", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003da", condition()) + ) + ) + Block("1660:l00000252", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003da", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R10, bv64) := 69632bv64) + LocalAssign(Register(R10, bv64) := BinaryExpr("add", Register(R10, bv64), 64bv64)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R12, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R11, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R10, bv64)]), 32)) + LocalAssign(Register(R13, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 48bv64)]), 32)) + LocalAssign(Register(R14, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 56bv64)])) + LocalAssign(Register(R11, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R11, bv64)[32:0]), 3bv32), 32)) + LocalAssign(Register(R15, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R12, bv64), 52bv64)]), 56)) + LocalAssign(Register(R13, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R13, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R14, bv64) := BinaryExpr("add", Register(R14, bv64), 18446744073709551615bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R10, bv64), 4bv64)] := Extract(Register(R11, bv64)[32:0]))) + LocalAssign(Register(R10, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R15, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 48bv64)] := Extract(Register(R13, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Register(R14, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R12, bv64), 52bv64)] := Extract(Register(R10, bv64)[8:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003a9", condition()) + ) + ) + Block("1700:l000003a9", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003bc", condition()) + ) + ) + Block("1720:l0000028e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003bc", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/initialisation/clang_no_plt_no_pic/initialisation-before-analysis.il.expected b/src/test/correct/initialisation/clang_no_plt_no_pic/initialisation-before-analysis.il.expected new file mode 100644 index 000000000..270922294 --- /dev/null +++ b/src/test/correct/initialisation/clang_no_plt_no_pic/initialisation-before-analysis.il.expected @@ -0,0 +1,325 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000919", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000009d5", condition()) + ) + ) + Block("1752:l000009d5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000009e3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009fc", condition()) + ) + ) + Block("1764:l000009fc", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000009e3", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009ef", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000919", condition()) + ) + ) + Block("1788:l00000919", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1892:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1892:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000be3", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000843", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c79", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000859", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a4c", condition()) + ) + ) + Block("1604:l00000859", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a4c", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000089e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000a2e", condition()) + ) + ) + Block("1640:l00000a2e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000089e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a41", condition()) + ) + ) + Block("1660:l0000089e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a41", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := BinaryExpr("add", Register(R9, bv64), 64bv64)) + LocalAssign(Register(R11, bv64) := 69632bv64) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R11, bv64), 48bv64)]), 32)) + LocalAssign(Register(R10, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R10, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R11, bv64), 48bv64)] := Extract(Register(R10, bv64)[32:0]))) + LocalAssign(Register(R11, bv64) := 69632bv64) + LocalAssign(Register(R10, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R11, bv64), 56bv64)])) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R10, bv64), 18446744073709551614bv64)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv64), 1bv64), 1), BinaryExpr("add", SignExtend(Register(R10, bv64), 1), 36893488147419103231bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv64), 1bv64), 1), BinaryExpr("add", ZeroExtend(Register(R10, bv64), 1), 18446744073709551615bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv64), 1bv64)[64:63])) + LocalAssign(Register(R10, bv64) := BinaryExpr("add", LocalVar(#4, bv64), 1bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R11, bv64), 56bv64)] := Register(R10, bv64))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 64bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 3bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 56)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008da", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000a10", condition()) + ) + ) + Block("1700:l00000a10", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000008da", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000a23", condition()) + ) + ) + Block("1720:l000008da", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000a23", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/initialisation/clang_pic/initialisation-before-analysis.il.expected b/src/test/correct/initialisation/clang_pic/initialisation-before-analysis.il.expected new file mode 100644 index 000000000..492481689 --- /dev/null +++ b/src/test/correct/initialisation/clang_pic/initialisation-before-analysis.il.expected @@ -0,0 +1,327 @@ +Procedure("1584:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1856:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) + ), + jumps( + GoTo("1916:l000002d9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1880:l000003a6", condition()) + ) + ) + Block("1880:l000003a6", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4008bv64)])) + ), + jumps( + GoTo("1904:l000003b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1892:l000003cd", condition()) + ) + ) + Block("1892:l000003cd", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1904bv64) + ), + jumps( + DirectCall("1584:__cxa_finalize", condition()) + ) + ) + Block("1904:l000003b4", + statements( + LocalAssign(Register(R30, bv64) := 1908bv64) + ), + jumps( + DirectCall("1744:deregister_tm_clones", condition()) + ) + ) + Block("1908:l000003c0", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1916:l000002d9", condition()) + ) + ) + Block("1916:l000002d9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1568:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1568:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2028:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2028:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1504:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1504:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1520bv64) + ), + jumps( + DirectCall("1716:call_weak_fn", condition()) + ) + ) + Block("1520:l00000554", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1712bv64) + ), + jumps( + DirectCall("1568:__libc_start_main", condition()) + ) + ) + Block("1712:l00000203", + statements( + LocalAssign(Register(R30, bv64) := 1716bv64) + ), + jumps( + DirectCall("1616:abort", condition()) + ) + ) + Block("?:l000005f5", + statements( + ), + jumps( + DirectCall("1716:call_weak_fn", condition()) + ) + ) +)), +Procedure("1616:abort", in(), out(), blocks( +)), +Procedure("1716:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1716:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) + ), + jumps( + GoTo("1732:l00000219", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1728:l0000041d", condition()) + ) + ) + Block("1732:l00000219", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1728:l0000041d", + statements( + ), + jumps( + GoTo("1600:l__gmon_start__", condition()) + ) + ) + Block("1600:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1744:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1744:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1788:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1768:l000003ff", condition()) + ) + ) + Block("1768:l000003ff", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4000bv64)])) + ), + jumps( + GoTo("1788:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1780:l00000412", condition()) + ) + ) + Block("1788:l0000025e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1780:l00000412", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1936:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1936:lframe_dummy", + statements( + ), + jumps( + DirectCall("1792:register_tm_clones", condition()) + ) + ) +)), +Procedure("1940:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1940:lmain", + statements( + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4040bv64)])) + LocalAssign(Register(R10, bv64) := 65536bv64) + LocalAssign(Register(R10, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R10, bv64), 4024bv64)])) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R10, bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R10, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R10, bv64) := 65536bv64) + LocalAssign(Register(R10, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R10, bv64), 4016bv64)])) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R10, bv64)])) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R8, bv64), 18446744073709551614bv64)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv64), 1bv64), 1), BinaryExpr("add", SignExtend(Register(R8, bv64), 1), 36893488147419103231bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv64), 1bv64), 1), BinaryExpr("add", ZeroExtend(Register(R8, bv64), 1), 18446744073709551615bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv64), 1bv64)[64:63])) + LocalAssign(Register(R8, bv64) := BinaryExpr("add", LocalVar(#4, bv64), 1bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R10, bv64)] := Register(R8, bv64))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R9, bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 3bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4048bv64)])) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R9, bv64)]), 56)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1848:l0000029a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1828:l000003e1", condition()) + ) + ) + Block("1828:l000003e1", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1848:l0000029a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1840:l000003f4", condition()) + ) + ) + Block("1848:l0000029a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1840:l000003f4", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/initialisation/gcc/initialisation-before-analysis.il.expected b/src/test/correct/initialisation/gcc/initialisation-before-analysis.il.expected new file mode 100644 index 000000000..7fb87edec --- /dev/null +++ b/src/test/correct/initialisation/gcc/initialisation-before-analysis.il.expected @@ -0,0 +1,331 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 40bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002fd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000003e2", condition()) + ) + ) + Block("1752:l000003e2", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000003f0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000409", condition()) + ) + ) + Block("1764:l00000409", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000003f0", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000003fc", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 40bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002fd", condition()) + ) + ) + Block("1788:l000002fd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1936:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1936:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000005fb", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000227", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000006be", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l0000023d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000459", condition()) + ) + ) + Block("1604:l0000023d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000459", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 40bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 40bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000043b", condition()) + ) + ) + Block("1640:l0000043b", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000044e", condition()) + ) + ) + Block("1660:l00000282", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000044e", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)])) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R0, bv64), 18446744073709551615bv64)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Register(R1, bv64))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 32bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 3bv32), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 32bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R0, bv64), 4bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("++", 0bv24, Extract(Register(R0, bv64)[8:0])), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 40bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 40bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000041d", condition()) + ) + ) + Block("1700:l0000041d", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000430", condition()) + ) + ) + Block("1720:l000002be", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000430", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/initialisation/gcc_O2/initialisation-before-analysis.il.expected b/src/test/correct/initialisation/gcc_O2/initialisation-before-analysis.il.expected new file mode 100644 index 000000000..b3a347b76 --- /dev/null +++ b/src/test/correct/initialisation/gcc_O2/initialisation-before-analysis.il.expected @@ -0,0 +1,316 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 41bv64)]), 56)) + ), + jumps( + GoTo("1852:l0000032a", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000353", condition()) + ) + ) + Block("1816:l00000353", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l00000361", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000037a", condition()) + ) + ) + Block("1828:l0000037a", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000361", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000036d", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 41bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l0000032a", condition()) + ) + ) + Block("1852:l0000032a", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l0000055d", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000254", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000611", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l0000026a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003ca", condition()) + ) + ) + Block("1668:l0000026a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003ca", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l000002af", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003ac", condition()) + ) + ) + Block("1704:l000003ac", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l000002af", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003bf", condition()) + ) + ) + Block("1724:l000002af", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003bf", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R5, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R5, bv64), 16bv64)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R6, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R5, bv64), 16bv64)]), 32)) + LocalAssign(Register(R4, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 8bv64)])) + LocalAssign(Register(R6, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R6, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R2, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 24bv64)]), 56)) + LocalAssign(Register(R3, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) + LocalAssign(Register(R4, bv64) := BinaryExpr("add", Register(R4, bv64), 18446744073709551615bv64)) + LocalAssign(Register(R2, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R2, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R5, bv64), 16bv64)] := Extract(Register(R6, bv64)[32:0]))) + LocalAssign(Register(R3, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R3, bv64)[32:0]), 3bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 8bv64)] := Register(R4, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R3, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 24bv64)] := Extract(Register(R2, bv64)[8:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002eb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000038e", condition()) + ) + ) + Block("1764:l0000038e", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002eb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003a1", condition()) + ) + ) + Block("1784:l000002eb", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003a1", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/initialisation/gcc_no_plt_no_pic/initialisation-before-analysis.il.expected b/src/test/correct/initialisation/gcc_no_plt_no_pic/initialisation-before-analysis.il.expected new file mode 100644 index 000000000..93fce3cf7 --- /dev/null +++ b/src/test/correct/initialisation/gcc_no_plt_no_pic/initialisation-before-analysis.il.expected @@ -0,0 +1,331 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 40bv64)]), 56)) + ), + jumps( + GoTo("1788:l000009b0", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000a95", condition()) + ) + ) + Block("1752:l00000a95", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000aa3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000abc", condition()) + ) + ) + Block("1764:l00000abc", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000aa3", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000aaf", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 40bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000009b0", condition()) + ) + ) + Block("1788:l000009b0", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1936:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1936:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000cae", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000008da", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000d4f", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000008f0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000b0c", condition()) + ) + ) + Block("1604:l000008f0", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000b0c", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 40bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 40bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000935", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000aee", condition()) + ) + ) + Block("1640:l00000aee", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000935", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000b01", condition()) + ) + ) + Block("1660:l00000935", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000b01", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)])) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R0, bv64), 18446744073709551615bv64)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Register(R1, bv64))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 32bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 3bv32), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 32bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R0, bv64), 4bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("++", 0bv24, Extract(Register(R0, bv64)[8:0])), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 40bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 40bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000971", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000ad0", condition()) + ) + ) + Block("1700:l00000ad0", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000971", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000ae3", condition()) + ) + ) + Block("1720:l00000971", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000ae3", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/initialisation/gcc_pic/initialisation-before-analysis.il.expected b/src/test/correct/initialisation/gcc_pic/initialisation-before-analysis.il.expected new file mode 100644 index 000000000..9cac1b6ca --- /dev/null +++ b/src/test/correct/initialisation/gcc_pic/initialisation-before-analysis.il.expected @@ -0,0 +1,331 @@ +Procedure("1584:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1856:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 40bv64)]), 56)) + ), + jumps( + GoTo("1916:l000002fd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1880:l000003ea", condition()) + ) + ) + Block("1880:l000003ea", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) + ), + jumps( + GoTo("1904:l000003f8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1892:l00000411", condition()) + ) + ) + Block("1892:l00000411", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1904bv64) + ), + jumps( + DirectCall("1584:__cxa_finalize", condition()) + ) + ) + Block("1904:l000003f8", + statements( + LocalAssign(Register(R30, bv64) := 1908bv64) + ), + jumps( + DirectCall("1744:deregister_tm_clones", condition()) + ) + ) + Block("1908:l00000404", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 40bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1916:l000002fd", condition()) + ) + ) + Block("1916:l000002fd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1568:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1568:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3984bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3984bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2064:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1504:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1504:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1520bv64) + ), + jumps( + DirectCall("1716:call_weak_fn", condition()) + ) + ) + Block("1520:l00000598", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1712bv64) + ), + jumps( + DirectCall("1568:__libc_start_main", condition()) + ) + ) + Block("1712:l00000227", + statements( + LocalAssign(Register(R30, bv64) := 1716bv64) + ), + jumps( + DirectCall("1616:abort", condition()) + ) + ) + Block("?:l00000642", + statements( + ), + jumps( + DirectCall("1716:call_weak_fn", condition()) + ) + ) +)), +Procedure("1616:abort", in(), out(), blocks( +)), +Procedure("1716:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1716:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + ), + jumps( + GoTo("1732:l0000023d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1728:l00000461", condition()) + ) + ) + Block("1732:l0000023d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1728:l00000461", + statements( + ), + jumps( + GoTo("1600:l__gmon_start__", condition()) + ) + ) + Block("1600:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1744:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1744:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 40bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 40bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1788:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1768:l00000443", condition()) + ) + ) + Block("1768:l00000443", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) + ), + jumps( + GoTo("1788:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1780:l00000456", condition()) + ) + ) + Block("1788:l00000282", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1780:l00000456", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1936:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1936:lframe_dummy", + statements( + ), + jumps( + DirectCall("1792:register_tm_clones", condition()) + ) + ) +)), +Procedure("1940:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1940:lmain", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)])) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R0, bv64), 18446744073709551615bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Register(R1, bv64))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 3bv32), 32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R0, bv64), 4bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("++", 0bv24, Extract(Register(R0, bv64)[8:0])), 32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 40bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 40bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1848:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000425", condition()) + ) + ) + Block("1828:l00000425", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1848:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1840:l00000438", condition()) + ) + ) + Block("1848:l000002be", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1840:l00000438", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/jumptable/clang_O2/jumptable-before-analysis.il.expected b/src/test/correct/jumptable/clang_O2/jumptable-before-analysis.il.expected new file mode 100644 index 000000000..bd68d2a77 --- /dev/null +++ b/src/test/correct/jumptable/clang_O2/jumptable-before-analysis.il.expected @@ -0,0 +1,345 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 52bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000037f", condition()) + ) + ) + Block("1752:l0000037f", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000038d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003a6", condition()) + ) + ) + Block("1764:l000003a6", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000038d", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000399", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 52bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002d5", condition()) + ) + ) + Block("1788:l000002d5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1896:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l0000058e", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001ff", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000064d", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1832:add_six", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1832:ladd_six", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 48bv64)]), 32)) + LocalAssign(Register(R9, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R9, bv64)[32:0]), 6bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 48bv64)] := Extract(Register(R9, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1812:add_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1812:ladd_two", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 48bv64)]), 32)) + LocalAssign(Register(R9, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R9, bv64)[32:0]), 2bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 48bv64)] := Extract(Register(R9, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003f6", condition()) + ) + ) + Block("1604:l00000215", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003f6", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003d8", condition()) + ) + ) + Block("1640:l000003d8", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003eb", condition()) + ) + ) + Block("1660:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003eb", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1872:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1872:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 48bv64)]), 32)) + LocalAssign(Register(R9, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R9, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 48bv64)] := Extract(Register(R9, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003ba", condition()) + ) + ) + Block("1700:l000003ba", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003cd", condition()) + ) + ) + Block("1720:l00000296", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003cd", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1852:sub_seven", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1852:lsub_seven", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 48bv64)]), 32)) + LocalAssign(Register(R9, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R9, bv64)[32:0]), 4294967289bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 48bv64)] := Extract(Register(R9, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/jumptable/gcc_O2/jumptable-before-analysis.il.expected b/src/test/correct/jumptable/gcc_O2/jumptable-before-analysis.il.expected new file mode 100644 index 000000000..829c99cb2 --- /dev/null +++ b/src/test/correct/jumptable/gcc_O2/jumptable-before-analysis.il.expected @@ -0,0 +1,373 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 20bv64)]), 56)) + ), + jumps( + GoTo("1852:l000003cd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000003fc", condition()) + ) + ) + Block("1816:l000003fc", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000040a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000423", condition()) + ) + ) + Block("1828:l00000423", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000040a", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000416", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 20bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000003cd", condition()) + ) + ) + Block("1852:l000003cd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1956:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1956:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l0000061a", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l000002f7", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000006e8", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1908:add_six", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1908:ladd_six", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 6bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1888:add_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1888:ladd_two", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 2bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l0000030d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000473", condition()) + ) + ) + Block("1668:l0000030d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000473", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) + LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000352", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000455", condition()) + ) + ) + Block("1704:l00000455", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000352", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000468", condition()) + ) + ) + Block("1724:l00000352", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000468", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(LocalVar(#1, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#1, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#1, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#1, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1548bv64) + ), + jumps( + DirectCall("1888:add_two", condition()) + ) + ) + Block("1548:l0000027c", + statements( + LocalAssign(Register(R30, bv64) := 1552bv64) + ), + jumps( + DirectCall("1908:add_six", condition()) + ) + ) + Block("1552:l00000283", + statements( + LocalAssign(Register(R30, bv64) := 1556bv64) + ), + jumps( + DirectCall("1936:sub_seven", condition()) + ) + ) + Block("1556:l0000028a", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000038e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000437", condition()) + ) + ) + Block("1764:l00000437", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l0000038e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000044a", condition()) + ) + ) + Block("1784:l0000038e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000044a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1936:sub_seven", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1936:lsub_seven", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/jumptable3/gcc/jumptable3-before-analysis.il.expected b/src/test/correct/jumptable3/gcc/jumptable3-before-analysis.il.expected new file mode 100644 index 000000000..66c205083 --- /dev/null +++ b/src/test/correct/jumptable3/gcc/jumptable3-before-analysis.il.expected @@ -0,0 +1,893 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 20bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000048d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000009a5", condition()) + ) + ) + Block("1752:l000009a5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000009b3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009cc", condition()) + ) + ) + Block("1764:l000009cc", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000009b3", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009bf", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 20bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000048d", condition()) + ) + ) + Block("1788:l0000048d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2336:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2336:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#28, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#28, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#28, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#28, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000c22", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000003b7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000d66", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1848:add_six", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1848:ladd_six", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 6bv32), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1812:add_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1812:ladd_two", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 2bv32), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000003cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a1c", condition()) + ) + ) + Block("1604:l000003cd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a1c", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000412", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009fe", condition()) + ) + ) + Block("1640:l000009fe", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000412", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a11", condition()) + ) + ) + Block("1660:l00000412", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a11", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1920:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1920:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967284bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934581bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967285bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2296:l00000599", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1948:l000005e0", condition()) + ) + ) + Block("1948:l000005e0", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967284bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934581bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967285bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("1960:l00000608", condition()) + ) + ) + Block("1960:l00000608", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#7, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967285bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934582bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967286bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#7, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2284:l00000629", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1972:l00000643", condition()) + ) + ) + Block("2284:l00000629", + statements( + LocalAssign(Register(R30, bv64) := 2288bv64) + ), + jumps( + DirectCall("1884:sub_seven", condition()) + ) + ) + Block("2288:l00000635", + statements( + LocalAssign(Register(R30, bv64) := 2292bv64) + ), + jumps( + DirectCall("1812:add_two", condition()) + ) + ) + Block("2292:l0000063c", + statements( + LocalAssign(Register(R30, bv64) := 2296bv64) + ), + jumps( + DirectCall("1848:add_six", condition()) + ) + ) + Block("2296:l00000599", + statements( + LocalAssign(Register(R30, bv64) := 2300bv64) + ), + jumps( + DirectCall("1884:sub_seven", condition()) + ) + ) + Block("2300:l000005a5", + statements( + LocalAssign(Register(R30, bv64) := 2304bv64) + ), + jumps( + DirectCall("1812:add_two", condition()) + ) + ) + Block("2304:l000005ac", + statements( + ), + jumps( + GoTo("2316:l000005ad", condition()) + ) + ) + Block("1972:l00000643", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#8, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967285bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934582bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967286bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#8, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("1984:l0000066b", condition()) + ) + ) + Block("1984:l0000066b", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#9, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967286bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934583bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967287bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#9, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2272:l0000068c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1996:l000006a3", condition()) + ) + ) + Block("2272:l0000068c", + statements( + LocalAssign(Register(R30, bv64) := 2276bv64) + ), + jumps( + DirectCall("1812:add_two", condition()) + ) + ) + Block("2276:l00000698", + statements( + LocalAssign(Register(R30, bv64) := 2280bv64) + ), + jumps( + DirectCall("1848:add_six", condition()) + ) + ) + Block("2280:l0000069f", + statements( + ), + jumps( + GoTo("2316:l000005ad", condition()) + ) + ) + Block("1996:l000006a3", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#10, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967286bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934583bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967287bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#10, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2008:l000006cb", condition()) + ) + ) + Block("2008:l000006cb", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#11, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967287bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934584bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967288bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#11, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2260:l000006ec", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2020:l00000703", condition()) + ) + ) + Block("2020:l00000703", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#12, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967287bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934584bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967288bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#12, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2032:l0000072b", condition()) + ) + ) + Block("2032:l0000072b", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#13, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967288bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934585bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967289bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#13, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2256:l0000074c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2044:l00000758", condition()) + ) + ) + Block("2044:l00000758", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#14, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967288bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#14, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934585bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#14, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967289bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#14, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#14, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2056:l00000780", condition()) + ) + ) + Block("2056:l00000780", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#15, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#15, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934586bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#15, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967290bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#15, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#15, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2252:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2068:l000007ad", condition()) + ) + ) + Block("2068:l000007ad", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#16, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#16, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934586bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#16, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967290bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#16, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#16, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2080:l000007d5", condition()) + ) + ) + Block("2080:l000007d5", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#17, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#17, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#17, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#17, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#17, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2244:l000007f6", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2092:l00000809", condition()) + ) + ) + Block("2244:l000007f6", + statements( + LocalAssign(Register(R30, bv64) := 2248bv64) + ), + jumps( + DirectCall("1848:add_six", condition()) + ) + ) + Block("2248:l00000802", + statements( + LocalAssign(Register(R30, bv64) := 2252bv64) + ), + jumps( + DirectCall("1812:add_two", condition()) + ) + ) + Block("2252:l000007a1", + statements( + LocalAssign(Register(R30, bv64) := 2256bv64) + ), + jumps( + DirectCall("1848:add_six", condition()) + ) + ) + Block("2256:l0000074c", + statements( + LocalAssign(Register(R30, bv64) := 2260bv64) + ), + jumps( + DirectCall("1884:sub_seven", condition()) + ) + ) + Block("2260:l000006ec", + statements( + LocalAssign(Register(R30, bv64) := 2264bv64) + ), + jumps( + DirectCall("1884:sub_seven", condition()) + ) + ) + Block("2264:l000006f8", + statements( + LocalAssign(Register(R30, bv64) := 2268bv64) + ), + jumps( + DirectCall("1848:add_six", condition()) + ) + ) + Block("2268:l000006ff", + statements( + ), + jumps( + GoTo("2316:l000005ad", condition()) + ) + ) + Block("2092:l00000809", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#18, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#18, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#18, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#18, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#18, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2104:l00000831", condition()) + ) + ) + Block("2104:l00000831", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#19, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#19, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#19, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#19, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#19, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2236:l00000852", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2116:l00000862", condition()) + ) + ) + Block("2236:l00000852", + statements( + LocalAssign(Register(R30, bv64) := 2240bv64) + ), + jumps( + DirectCall("1848:add_six", condition()) + ) + ) + Block("2240:l0000085e", + statements( + ), + jumps( + GoTo("2316:l000005ad", condition()) + ) + ) + Block("2116:l00000862", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#20, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#20, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#20, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#20, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#20, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2128:l0000088a", condition()) + ) + ) + Block("2128:l0000088a", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#21, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#21, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#21, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#21, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#21, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2224:l000008ab", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2140:l000008c2", condition()) + ) + ) + Block("2224:l000008ab", + statements( + LocalAssign(Register(R30, bv64) := 2228bv64) + ), + jumps( + DirectCall("1812:add_two", condition()) + ) + ) + Block("2228:l000008b7", + statements( + LocalAssign(Register(R30, bv64) := 2232bv64) + ), + jumps( + DirectCall("1884:sub_seven", condition()) + ) + ) + Block("2232:l000008be", + statements( + ), + jumps( + GoTo("2316:l000005ad", condition()) + ) + ) + Block("2140:l000008c2", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#22, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#22, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#22, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#22, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#22, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2152:l000008ea", condition()) + ) + ) + Block("2152:l000008ea", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#23, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#23, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#23, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#23, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#23, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2216:l0000090b", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2164:l0000091b", condition()) + ) + ) + Block("2164:l0000091b", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#24, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#24, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#24, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#24, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#24, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2176:l00000943", condition()) + ) + ) + Block("2176:l00000943", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#25, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#25, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#25, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#25, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#25, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2204:l00000964", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2188:l0000097b", condition()) + ) + ) + Block("2204:l00000964", + statements( + LocalAssign(Register(R30, bv64) := 2208bv64) + ), + jumps( + DirectCall("1812:add_two", condition()) + ) + ) + Block("2208:l00000970", + statements( + ), + jumps( + GoTo("2316:l000005ad", condition()) + ) + ) + Block("2188:l0000097b", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#26, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#26, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#26, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#26, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#26, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2212:l00000974", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2200:l000009a1", condition()) + ) + ) + Block("2212:l00000974", + statements( + LocalAssign(Register(R30, bv64) := 2216bv64) + ), + jumps( + DirectCall("1848:add_six", condition()) + ) + ) + Block("2216:l0000090b", + statements( + LocalAssign(Register(R30, bv64) := 2220bv64) + ), + jumps( + DirectCall("1884:sub_seven", condition()) + ) + ) + Block("2220:l00000917", + statements( + ), + jumps( + GoTo("2316:l000005ad", condition()) + ) + ) + Block("2316:l000005ad", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + ), + jumps( + GoTo("2328:l000005c2", condition()) + ) + ) + Block("2200:l000009a1", + statements( + ), + jumps( + GoTo("2308:l000005d7", condition()) + ) + ) + Block("2308:l000005d7", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + ), + jumps( + GoTo("2328:l000005c2", condition()) + ) + ) + Block("2328:l000005c2", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000044e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009e0", condition()) + ) + ) + Block("1700:l000009e0", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000044e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009f3", condition()) + ) + ) + Block("1720:l0000044e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009f3", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1884:sub_seven", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1884:lsub_seven", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/jumptable3/gcc_O2/jumptable3-before-analysis.il.expected b/src/test/correct/jumptable3/gcc_O2/jumptable3-before-analysis.il.expected new file mode 100644 index 000000000..820d2312d --- /dev/null +++ b/src/test/correct/jumptable3/gcc_O2/jumptable3-before-analysis.il.expected @@ -0,0 +1,636 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2048:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2048:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 20bv64)]), 56)) + ), + jumps( + GoTo("2108:l00000497", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2072:l00000527", condition()) + ) + ) + Block("2072:l00000527", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("2096:l00000535", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2084:l0000054e", condition()) + ) + ) + Block("2084:l0000054e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2096bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("2096:l00000535", + statements( + LocalAssign(Register(R30, bv64) := 2100bv64) + ), + jumps( + DirectCall("1936:deregister_tm_clones", condition()) + ) + ) + Block("2100:l00000541", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 20bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2108:l00000497", condition()) + ) + ) + Block("2108:l00000497", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2212:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2212:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#15, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#15, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#15, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#15, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1908:call_weak_fn", condition()) + ) + ) + Block("1424:l000009a9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1856:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1904bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1904:l000003c1", + statements( + LocalAssign(Register(R30, bv64) := 1908bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000ac8", + statements( + ), + jumps( + DirectCall("1908:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("2164:add_six", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2164:ladd_six", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 6bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("2144:add_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2144:ladd_two", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 2bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1908:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1908:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1924:l000003d7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1920:l0000059e", condition()) + ) + ) + Block("1924:l000003d7", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1920:l0000059e", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1936:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1936:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) + LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1980:l0000041c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1960:l00000580", condition()) + ) + ) + Block("1960:l00000580", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1980:l0000041c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1972:l00000593", condition()) + ) + ) + Block("1980:l0000041c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1972:l00000593", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2128:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2128:lframe_dummy", + statements( + ), + jumps( + DirectCall("1984:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(LocalVar(#1, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#1, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934586bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#1, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967290bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#1, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#1, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1644:l00000317", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1548:l00000753", condition()) + ) + ) + Block("1548:l00000753", + statements( + ), + jumps( + GoTo("1672:l000006e8", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("1552:l0000075c", condition()) + ) + ) + Block("1672:l000006e8", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(LocalVar(#8, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967286bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934583bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967287bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#8, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1808:l000005f9", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1684:l0000070c", condition()) + ) + ) + Block("1808:l000005f9", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 8bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1596:l00000360", condition()) + ) + ) + Block("1684:l0000070c", + statements( + ), + jumps( + GoTo("1720:l00000644", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1))), 0bv1))) + GoTo("1688:l00000715", condition()) + ) + ) + Block("1720:l00000644", + statements( + LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967288bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934585bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967289bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1656:l00000331", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1728:l00000663", condition()) + ) + ) + Block("1728:l00000663", + statements( + LocalAssign(LocalVar(#7, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967287bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934584bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967288bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#7, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1840:l0000036b", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1736:l00000347", condition()) + ) + ) + Block("1688:l00000715", + statements( + LocalAssign(LocalVar(#9, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967285bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934582bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967286bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#9, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1824:l00000612", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1696:l00000734", condition()) + ) + ) + Block("1824:l00000612", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1704:l00000628", condition()) + ) + ) + Block("1696:l00000734", + statements( + LocalAssign(LocalVar(#10, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967284bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934581bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967285bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#10, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1840:l0000036b", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1704:l00000628", condition()) + ) + ) + Block("1704:l00000628", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1596:l00000360", condition()) + ) + ) + Block("1552:l0000075c", + statements( + LocalAssign(LocalVar(#11, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#11, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1752:l0000069c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1560:l0000077b", condition()) + ) + ) + Block("1752:l0000069c", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1596:l00000360", condition()) + ) + ) + Block("1560:l0000077b", + statements( + ), + jumps( + GoTo("1620:l000005bc", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("1564:l00000784", condition()) + ) + ) + Block("1620:l000005bc", + statements( + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1788:l000005d6", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1628:l00000682", condition()) + ) + ) + Block("1788:l000005d6", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 6bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1596:l00000360", condition()) + ) + ) + Block("1628:l00000682", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 8bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1644:l00000317", condition()) + ) + ) + Block("1644:l00000317", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 6bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1656:l00000331", condition()) + ) + ) + Block("1656:l00000331", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1736:l00000347", condition()) + ) + ) + Block("1736:l00000347", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1596:l00000360", condition()) + ) + ) + Block("1564:l00000784", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(LocalVar(#12, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#12, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1772:l000006ba", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1576:l000007a8", condition()) + ) + ) + Block("1772:l000006ba", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 6bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1584:l000006d0", condition()) + ) + ) + Block("1576:l000007a8", + statements( + LocalAssign(LocalVar(#13, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#13, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1600:l00000368", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1584:l000006d0", condition()) + ) + ) + Block("1600:l00000368", + statements( + ), + jumps( + GoTo("1840:l0000036b", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1604:l000005a3", condition()) + ) + ) + Block("1840:l0000036b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1604:l000005a3", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 2bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1596:l00000360", condition()) + ) + ) + Block("1584:l000006d0", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1596:l00000360", condition()) + ) + ) + Block("1596:l00000360", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1984:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("2040:l00000458", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000562", condition()) + ) + ) + Block("2020:l00000562", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("2040:l00000458", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("2032:l00000575", condition()) + ) + ) + Block("2040:l00000458", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("2032:l00000575", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2192:sub_seven", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2192:lsub_seven", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/jumptable3/gcc_no_plt_no_pic/jumptable3-before-analysis.il.expected b/src/test/correct/jumptable3/gcc_no_plt_no_pic/jumptable3-before-analysis.il.expected new file mode 100644 index 000000000..58774350b --- /dev/null +++ b/src/test/correct/jumptable3/gcc_no_plt_no_pic/jumptable3-before-analysis.il.expected @@ -0,0 +1,893 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 20bv64)]), 56)) + ), + jumps( + GoTo("1788:l000011e8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00001700", condition()) + ) + ) + Block("1752:l00001700", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l0000170e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00001727", condition()) + ) + ) + Block("1764:l00001727", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000170e", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000171a", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 20bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000011e8", condition()) + ) + ) + Block("1788:l000011e8", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2336:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2336:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#28, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#28, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#28, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#28, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l0000197d", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00001112", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00001a82", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1848:add_six", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1848:ladd_six", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 6bv32), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1812:add_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1812:ladd_two", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 2bv32), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00001128", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00001777", condition()) + ) + ) + Block("1604:l00001128", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00001777", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000116d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00001759", condition()) + ) + ) + Block("1640:l00001759", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000116d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000176c", condition()) + ) + ) + Block("1660:l0000116d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000176c", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1920:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1920:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967284bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934581bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967285bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2296:l000012f4", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1948:l0000133b", condition()) + ) + ) + Block("1948:l0000133b", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967284bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934581bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967285bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("1960:l00001363", condition()) + ) + ) + Block("1960:l00001363", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#7, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967285bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934582bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967286bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#7, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2284:l00001384", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1972:l0000139e", condition()) + ) + ) + Block("2284:l00001384", + statements( + LocalAssign(Register(R30, bv64) := 2288bv64) + ), + jumps( + DirectCall("1884:sub_seven", condition()) + ) + ) + Block("2288:l00001390", + statements( + LocalAssign(Register(R30, bv64) := 2292bv64) + ), + jumps( + DirectCall("1812:add_two", condition()) + ) + ) + Block("2292:l00001397", + statements( + LocalAssign(Register(R30, bv64) := 2296bv64) + ), + jumps( + DirectCall("1848:add_six", condition()) + ) + ) + Block("2296:l000012f4", + statements( + LocalAssign(Register(R30, bv64) := 2300bv64) + ), + jumps( + DirectCall("1884:sub_seven", condition()) + ) + ) + Block("2300:l00001300", + statements( + LocalAssign(Register(R30, bv64) := 2304bv64) + ), + jumps( + DirectCall("1812:add_two", condition()) + ) + ) + Block("2304:l00001307", + statements( + ), + jumps( + GoTo("2316:l00001308", condition()) + ) + ) + Block("1972:l0000139e", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#8, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967285bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934582bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967286bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#8, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("1984:l000013c6", condition()) + ) + ) + Block("1984:l000013c6", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#9, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967286bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934583bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967287bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#9, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2272:l000013e7", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1996:l000013fe", condition()) + ) + ) + Block("2272:l000013e7", + statements( + LocalAssign(Register(R30, bv64) := 2276bv64) + ), + jumps( + DirectCall("1812:add_two", condition()) + ) + ) + Block("2276:l000013f3", + statements( + LocalAssign(Register(R30, bv64) := 2280bv64) + ), + jumps( + DirectCall("1848:add_six", condition()) + ) + ) + Block("2280:l000013fa", + statements( + ), + jumps( + GoTo("2316:l00001308", condition()) + ) + ) + Block("1996:l000013fe", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#10, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967286bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934583bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967287bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#10, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2008:l00001426", condition()) + ) + ) + Block("2008:l00001426", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#11, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967287bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934584bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967288bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#11, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2260:l00001447", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2020:l0000145e", condition()) + ) + ) + Block("2020:l0000145e", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#12, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967287bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934584bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967288bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#12, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2032:l00001486", condition()) + ) + ) + Block("2032:l00001486", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#13, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967288bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934585bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967289bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#13, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2256:l000014a7", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2044:l000014b3", condition()) + ) + ) + Block("2044:l000014b3", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#14, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967288bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#14, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934585bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#14, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967289bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#14, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#14, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2056:l000014db", condition()) + ) + ) + Block("2056:l000014db", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#15, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#15, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934586bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#15, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967290bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#15, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#15, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2252:l000014fc", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2068:l00001508", condition()) + ) + ) + Block("2068:l00001508", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#16, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#16, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934586bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#16, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967290bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#16, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#16, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2080:l00001530", condition()) + ) + ) + Block("2080:l00001530", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#17, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#17, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#17, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#17, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#17, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2244:l00001551", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2092:l00001564", condition()) + ) + ) + Block("2244:l00001551", + statements( + LocalAssign(Register(R30, bv64) := 2248bv64) + ), + jumps( + DirectCall("1848:add_six", condition()) + ) + ) + Block("2248:l0000155d", + statements( + LocalAssign(Register(R30, bv64) := 2252bv64) + ), + jumps( + DirectCall("1812:add_two", condition()) + ) + ) + Block("2252:l000014fc", + statements( + LocalAssign(Register(R30, bv64) := 2256bv64) + ), + jumps( + DirectCall("1848:add_six", condition()) + ) + ) + Block("2256:l000014a7", + statements( + LocalAssign(Register(R30, bv64) := 2260bv64) + ), + jumps( + DirectCall("1884:sub_seven", condition()) + ) + ) + Block("2260:l00001447", + statements( + LocalAssign(Register(R30, bv64) := 2264bv64) + ), + jumps( + DirectCall("1884:sub_seven", condition()) + ) + ) + Block("2264:l00001453", + statements( + LocalAssign(Register(R30, bv64) := 2268bv64) + ), + jumps( + DirectCall("1848:add_six", condition()) + ) + ) + Block("2268:l0000145a", + statements( + ), + jumps( + GoTo("2316:l00001308", condition()) + ) + ) + Block("2092:l00001564", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#18, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#18, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#18, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#18, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#18, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2104:l0000158c", condition()) + ) + ) + Block("2104:l0000158c", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#19, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#19, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#19, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#19, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#19, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2236:l000015ad", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2116:l000015bd", condition()) + ) + ) + Block("2236:l000015ad", + statements( + LocalAssign(Register(R30, bv64) := 2240bv64) + ), + jumps( + DirectCall("1848:add_six", condition()) + ) + ) + Block("2240:l000015b9", + statements( + ), + jumps( + GoTo("2316:l00001308", condition()) + ) + ) + Block("2116:l000015bd", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#20, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#20, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#20, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#20, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#20, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2128:l000015e5", condition()) + ) + ) + Block("2128:l000015e5", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#21, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#21, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#21, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#21, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#21, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2224:l00001606", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2140:l0000161d", condition()) + ) + ) + Block("2224:l00001606", + statements( + LocalAssign(Register(R30, bv64) := 2228bv64) + ), + jumps( + DirectCall("1812:add_two", condition()) + ) + ) + Block("2228:l00001612", + statements( + LocalAssign(Register(R30, bv64) := 2232bv64) + ), + jumps( + DirectCall("1884:sub_seven", condition()) + ) + ) + Block("2232:l00001619", + statements( + ), + jumps( + GoTo("2316:l00001308", condition()) + ) + ) + Block("2140:l0000161d", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#22, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#22, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#22, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#22, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#22, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2152:l00001645", condition()) + ) + ) + Block("2152:l00001645", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#23, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#23, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#23, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#23, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#23, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2216:l00001666", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2164:l00001676", condition()) + ) + ) + Block("2164:l00001676", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#24, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#24, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#24, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#24, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#24, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2176:l0000169e", condition()) + ) + ) + Block("2176:l0000169e", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#25, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#25, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#25, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#25, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#25, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2204:l000016bf", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2188:l000016d6", condition()) + ) + ) + Block("2204:l000016bf", + statements( + LocalAssign(Register(R30, bv64) := 2208bv64) + ), + jumps( + DirectCall("1812:add_two", condition()) + ) + ) + Block("2208:l000016cb", + statements( + ), + jumps( + GoTo("2316:l00001308", condition()) + ) + ) + Block("2188:l000016d6", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#26, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#26, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#26, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#26, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#26, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2212:l000016cf", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2200:l000016fc", condition()) + ) + ) + Block("2212:l000016cf", + statements( + LocalAssign(Register(R30, bv64) := 2216bv64) + ), + jumps( + DirectCall("1848:add_six", condition()) + ) + ) + Block("2216:l00001666", + statements( + LocalAssign(Register(R30, bv64) := 2220bv64) + ), + jumps( + DirectCall("1884:sub_seven", condition()) + ) + ) + Block("2220:l00001672", + statements( + ), + jumps( + GoTo("2316:l00001308", condition()) + ) + ) + Block("2316:l00001308", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + ), + jumps( + GoTo("2328:l0000131d", condition()) + ) + ) + Block("2200:l000016fc", + statements( + ), + jumps( + GoTo("2308:l00001332", condition()) + ) + ) + Block("2308:l00001332", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + ), + jumps( + GoTo("2328:l0000131d", condition()) + ) + ) + Block("2328:l0000131d", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000011a9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000173b", condition()) + ) + ) + Block("1700:l0000173b", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000011a9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000174e", condition()) + ) + ) + Block("1720:l000011a9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000174e", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1884:sub_seven", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1884:lsub_seven", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/jumptable3/gcc_pic/jumptable3-before-analysis.il.expected b/src/test/correct/jumptable3/gcc_pic/jumptable3-before-analysis.il.expected new file mode 100644 index 000000000..e0e6e799f --- /dev/null +++ b/src/test/correct/jumptable3/gcc_pic/jumptable3-before-analysis.il.expected @@ -0,0 +1,893 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 20bv64)]), 56)) + ), + jumps( + GoTo("1852:l0000048d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000009ac", condition()) + ) + ) + Block("1816:l000009ac", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + ), + jumps( + GoTo("1840:l000009ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l000009d3", condition()) + ) + ) + Block("1828:l000009d3", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l000009ba", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000009c6", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 20bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l0000048d", condition()) + ) + ) + Block("1852:l0000048d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2400:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2400:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#28, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#28, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#28, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#28, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l00000b5a", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000003b7", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l00000c9e", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1912:add_six", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1912:ladd_six", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 6bv32), 32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1876:add_two", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:ladd_two", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 2bv32), 32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l000003cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000a23", condition()) + ) + ) + Block("1668:l000003cd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000a23", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000412", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000a05", condition()) + ) + ) + Block("1704:l00000a05", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) + ), + jumps( + GoTo("1724:l00000412", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000a18", condition()) + ) + ) + Block("1724:l00000412", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000a18", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1984:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1984:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967284bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934581bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967285bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2360:l0000059f", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2012:l000005e7", condition()) + ) + ) + Block("2012:l000005e7", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967284bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934581bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967285bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2024:l0000060f", condition()) + ) + ) + Block("2024:l0000060f", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#7, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967285bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934582bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967286bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#7, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2348:l00000630", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2036:l0000064a", condition()) + ) + ) + Block("2348:l00000630", + statements( + LocalAssign(Register(R30, bv64) := 2352bv64) + ), + jumps( + DirectCall("1948:sub_seven", condition()) + ) + ) + Block("2352:l0000063c", + statements( + LocalAssign(Register(R30, bv64) := 2356bv64) + ), + jumps( + DirectCall("1876:add_two", condition()) + ) + ) + Block("2356:l00000643", + statements( + LocalAssign(Register(R30, bv64) := 2360bv64) + ), + jumps( + DirectCall("1912:add_six", condition()) + ) + ) + Block("2360:l0000059f", + statements( + LocalAssign(Register(R30, bv64) := 2364bv64) + ), + jumps( + DirectCall("1948:sub_seven", condition()) + ) + ) + Block("2364:l000005ab", + statements( + LocalAssign(Register(R30, bv64) := 2368bv64) + ), + jumps( + DirectCall("1876:add_two", condition()) + ) + ) + Block("2368:l000005b2", + statements( + ), + jumps( + GoTo("2380:l000005b3", condition()) + ) + ) + Block("2036:l0000064a", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#8, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967285bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934582bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967286bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#8, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2048:l00000672", condition()) + ) + ) + Block("2048:l00000672", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#9, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967286bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934583bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967287bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#9, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2336:l00000693", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2060:l000006aa", condition()) + ) + ) + Block("2336:l00000693", + statements( + LocalAssign(Register(R30, bv64) := 2340bv64) + ), + jumps( + DirectCall("1876:add_two", condition()) + ) + ) + Block("2340:l0000069f", + statements( + LocalAssign(Register(R30, bv64) := 2344bv64) + ), + jumps( + DirectCall("1912:add_six", condition()) + ) + ) + Block("2344:l000006a6", + statements( + ), + jumps( + GoTo("2380:l000005b3", condition()) + ) + ) + Block("2060:l000006aa", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#10, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967286bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934583bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967287bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#10, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2072:l000006d2", condition()) + ) + ) + Block("2072:l000006d2", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#11, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967287bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934584bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967288bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#11, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2324:l000006f3", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2084:l0000070a", condition()) + ) + ) + Block("2084:l0000070a", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#12, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967287bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934584bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967288bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#12, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2096:l00000732", condition()) + ) + ) + Block("2096:l00000732", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#13, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967288bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934585bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967289bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#13, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2320:l00000753", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2108:l0000075f", condition()) + ) + ) + Block("2108:l0000075f", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#14, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967288bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#14, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934585bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#14, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967289bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#14, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#14, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2120:l00000787", condition()) + ) + ) + Block("2120:l00000787", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#15, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#15, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934586bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#15, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967290bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#15, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#15, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2316:l000007a8", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2132:l000007b4", condition()) + ) + ) + Block("2132:l000007b4", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#16, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#16, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934586bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#16, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967290bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#16, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#16, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2144:l000007dc", condition()) + ) + ) + Block("2144:l000007dc", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#17, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#17, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#17, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#17, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#17, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2308:l000007fd", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2156:l00000810", condition()) + ) + ) + Block("2308:l000007fd", + statements( + LocalAssign(Register(R30, bv64) := 2312bv64) + ), + jumps( + DirectCall("1912:add_six", condition()) + ) + ) + Block("2312:l00000809", + statements( + LocalAssign(Register(R30, bv64) := 2316bv64) + ), + jumps( + DirectCall("1876:add_two", condition()) + ) + ) + Block("2316:l000007a8", + statements( + LocalAssign(Register(R30, bv64) := 2320bv64) + ), + jumps( + DirectCall("1912:add_six", condition()) + ) + ) + Block("2320:l00000753", + statements( + LocalAssign(Register(R30, bv64) := 2324bv64) + ), + jumps( + DirectCall("1948:sub_seven", condition()) + ) + ) + Block("2324:l000006f3", + statements( + LocalAssign(Register(R30, bv64) := 2328bv64) + ), + jumps( + DirectCall("1948:sub_seven", condition()) + ) + ) + Block("2328:l000006ff", + statements( + LocalAssign(Register(R30, bv64) := 2332bv64) + ), + jumps( + DirectCall("1912:add_six", condition()) + ) + ) + Block("2332:l00000706", + statements( + ), + jumps( + GoTo("2380:l000005b3", condition()) + ) + ) + Block("2156:l00000810", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#18, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#18, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#18, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#18, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#18, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2168:l00000838", condition()) + ) + ) + Block("2168:l00000838", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#19, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#19, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#19, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#19, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#19, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2300:l00000859", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2180:l00000869", condition()) + ) + ) + Block("2300:l00000859", + statements( + LocalAssign(Register(R30, bv64) := 2304bv64) + ), + jumps( + DirectCall("1912:add_six", condition()) + ) + ) + Block("2304:l00000865", + statements( + ), + jumps( + GoTo("2380:l000005b3", condition()) + ) + ) + Block("2180:l00000869", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#20, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#20, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#20, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#20, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#20, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2192:l00000891", condition()) + ) + ) + Block("2192:l00000891", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#21, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#21, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#21, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#21, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#21, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2288:l000008b2", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2204:l000008c9", condition()) + ) + ) + Block("2288:l000008b2", + statements( + LocalAssign(Register(R30, bv64) := 2292bv64) + ), + jumps( + DirectCall("1876:add_two", condition()) + ) + ) + Block("2292:l000008be", + statements( + LocalAssign(Register(R30, bv64) := 2296bv64) + ), + jumps( + DirectCall("1948:sub_seven", condition()) + ) + ) + Block("2296:l000008c5", + statements( + ), + jumps( + GoTo("2380:l000005b3", condition()) + ) + ) + Block("2204:l000008c9", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#22, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#22, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#22, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#22, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#22, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2216:l000008f1", condition()) + ) + ) + Block("2216:l000008f1", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#23, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#23, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#23, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#23, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#23, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2280:l00000912", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2228:l00000922", condition()) + ) + ) + Block("2228:l00000922", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#24, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#24, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#24, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#24, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#24, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("2240:l0000094a", condition()) + ) + ) + Block("2240:l0000094a", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#25, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#25, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#25, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#25, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#25, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2268:l0000096b", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2252:l00000982", condition()) + ) + ) + Block("2268:l0000096b", + statements( + LocalAssign(Register(R30, bv64) := 2272bv64) + ), + jumps( + DirectCall("1876:add_two", condition()) + ) + ) + Block("2272:l00000977", + statements( + ), + jumps( + GoTo("2380:l000005b3", condition()) + ) + ) + Block("2252:l00000982", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#26, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#26, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#26, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#26, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#26, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("2276:l0000097b", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2264:l000009a8", condition()) + ) + ) + Block("2276:l0000097b", + statements( + LocalAssign(Register(R30, bv64) := 2280bv64) + ), + jumps( + DirectCall("1912:add_six", condition()) + ) + ) + Block("2280:l00000912", + statements( + LocalAssign(Register(R30, bv64) := 2284bv64) + ), + jumps( + DirectCall("1948:sub_seven", condition()) + ) + ) + Block("2284:l0000091e", + statements( + ), + jumps( + GoTo("2380:l000005b3", condition()) + ) + ) + Block("2380:l000005b3", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + ), + jumps( + GoTo("2392:l000005c9", condition()) + ) + ) + Block("2264:l000009a8", + statements( + ), + jumps( + GoTo("2372:l000005de", condition()) + ) + ) + Block("2372:l000005de", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + ), + jumps( + GoTo("2392:l000005c9", condition()) + ) + ) + Block("2392:l000005c9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000044e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009e7", condition()) + ) + ) + Block("1764:l000009e7", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l0000044e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000009fa", condition()) + ) + ) + Block("1784:l0000044e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000009fa", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1948:sub_seven", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1948:lsub_seven", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32), 32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local/clang/malloc_with_local-before-analysis.il.expected b/src/test/correct/malloc_with_local/clang/malloc_with_local-before-analysis.il.expected new file mode 100644 index 000000000..050cfe8ef --- /dev/null +++ b/src/test/correct/malloc_with_local/clang/malloc_with_local-before-analysis.il.expected @@ -0,0 +1,401 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000329", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l0000047b", condition()) + ) + ) + Block("2008:l0000047b", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("2032:l00000489", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l000004a2", condition()) + ) + ) + Block("2020:l000004a2", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l00000489", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000495", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000329", condition()) + ) + ) + Block("2044:l00000329", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2236:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2236:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l0000069b", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l00000253", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l00000753", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1860:l00000269", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l000004f2", condition()) + ) + ) + Block("1860:l00000269", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l000004f2", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l000002ae", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l000004d4", condition()) + ) + ) + Block("1896:l000004d4", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1916:l000002ae", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l000004e7", condition()) + ) + ) + Block("1916:l000002ae", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l000004e7", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + LocalAssign(Register(R8, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2100bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2100:l00000391", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2112bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2112:l000003a5", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) + LocalAssign(Register(R8, bv64) := 10bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R8, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R8, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2260bv64)) + LocalAssign(Register(R30, bv64) := 2168bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2168:l00000403", + statements( + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2277bv64)) + LocalAssign(Register(R30, bv64) := 2188bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2188:l00000423", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2293bv64)) + LocalAssign(Register(R30, bv64) := 2204bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2204:l0000043c", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R30, bv64) := 2212bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2212:l0000044b", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2220bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2220:l00000459", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)]), 32)) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l000002ea", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l000004b6", condition()) + ) + ) + Block("1956:l000004b6", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1976:l000002ea", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l000004c9", condition()) + ) + ) + Block("1976:l000002ea", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l000004c9", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local/clang_O2/malloc_with_local-before-analysis.il.expected b/src/test/correct/malloc_with_local/clang_O2/malloc_with_local-before-analysis.il.expected new file mode 100644 index 000000000..425e44c2f --- /dev/null +++ b/src/test/correct/malloc_with_local/clang_O2/malloc_with_local-before-analysis.il.expected @@ -0,0 +1,345 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000036a", condition()) + ) + ) + Block("1816:l0000036a", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1840:l00000378", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000391", condition()) + ) + ) + Block("1828:l00000391", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000378", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000384", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002c5", condition()) + ) + ) + Block("1852:l000002c5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1944:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1464:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1480bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1480:l0000059b", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001ef", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l00000632", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003e1", condition()) + ) + ) + Block("1668:l00000205", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003e1", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003c3", condition()) + ) + ) + Block("1704:l000003c3", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003d6", condition()) + ) + ) + Block("1724:l0000024a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003d6", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1968bv64)) + LocalAssign(Register(R1, bv64) := 65bv64) + LocalAssign(Register(R30, bv64) := 1900bv64) + ), + jumps( + DirectCall("1584:printf", condition()) + ) + ) + Block("1900:l00000322", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1985bv64)) + LocalAssign(Register(R1, bv64) := 42bv64) + LocalAssign(Register(R30, bv64) := 1916bv64) + ), + jumps( + DirectCall("1584:printf", condition()) + ) + ) + Block("1916:l00000339", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2001bv64)) + LocalAssign(Register(R1, bv64) := 10bv64) + LocalAssign(Register(R30, bv64) := 1932bv64) + ), + jumps( + DirectCall("1584:printf", condition()) + ) + ) + Block("1932:l00000350", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1584:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003a5", condition()) + ) + ) + Block("1764:l000003a5", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003b8", condition()) + ) + ) + Block("1784:l00000286", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003b8", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local/clang_no_plt_no_pic/malloc_with_local-before-analysis.il.expected b/src/test/correct/malloc_with_local/clang_no_plt_no_pic/malloc_with_local-before-analysis.il.expected new file mode 100644 index 000000000..358645009 --- /dev/null +++ b/src/test/correct/malloc_with_local/clang_no_plt_no_pic/malloc_with_local-before-analysis.il.expected @@ -0,0 +1,401 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000a9b", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l00000bed", condition()) + ) + ) + Block("2008:l00000bed", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("2032:l00000bfb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000c14", condition()) + ) + ) + Block("2020:l00000c14", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l00000bfb", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000c07", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000a9b", condition()) + ) + ) + Block("2044:l00000a9b", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2236:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2236:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l00000e0d", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l000009c5", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l00000ec5", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1860:l000009db", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000c64", condition()) + ) + ) + Block("1860:l000009db", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000c64", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l00000a20", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000c46", condition()) + ) + ) + Block("1896:l00000c46", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1916:l00000a20", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000c59", condition()) + ) + ) + Block("1916:l00000a20", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000c59", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + LocalAssign(Register(R8, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2100bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2100:l00000b03", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2112bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2112:l00000b17", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) + LocalAssign(Register(R8, bv64) := 10bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R8, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R8, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2260bv64)) + LocalAssign(Register(R30, bv64) := 2168bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2168:l00000b75", + statements( + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2277bv64)) + LocalAssign(Register(R30, bv64) := 2188bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2188:l00000b95", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2293bv64)) + LocalAssign(Register(R30, bv64) := 2204bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2204:l00000bae", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R30, bv64) := 2212bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2212:l00000bbd", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2220bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2220:l00000bcb", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)]), 32)) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l00000a5c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000c28", condition()) + ) + ) + Block("1956:l00000c28", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1976:l00000a5c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l00000c3b", condition()) + ) + ) + Block("1976:l00000a5c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l00000c3b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local/clang_pic/malloc_with_local-before-analysis.il.expected b/src/test/correct/malloc_with_local/clang_pic/malloc_with_local-before-analysis.il.expected new file mode 100644 index 000000000..358645009 --- /dev/null +++ b/src/test/correct/malloc_with_local/clang_pic/malloc_with_local-before-analysis.il.expected @@ -0,0 +1,401 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000a9b", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l00000bed", condition()) + ) + ) + Block("2008:l00000bed", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("2032:l00000bfb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000c14", condition()) + ) + ) + Block("2020:l00000c14", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l00000bfb", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000c07", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000a9b", condition()) + ) + ) + Block("2044:l00000a9b", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2236:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2236:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l00000e0d", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l000009c5", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l00000ec5", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1860:l000009db", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000c64", condition()) + ) + ) + Block("1860:l000009db", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000c64", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l00000a20", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000c46", condition()) + ) + ) + Block("1896:l00000c46", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1916:l00000a20", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000c59", condition()) + ) + ) + Block("1916:l00000a20", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000c59", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + LocalAssign(Register(R8, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2100bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2100:l00000b03", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2112bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2112:l00000b17", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) + LocalAssign(Register(R8, bv64) := 10bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R8, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R8, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2260bv64)) + LocalAssign(Register(R30, bv64) := 2168bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2168:l00000b75", + statements( + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2277bv64)) + LocalAssign(Register(R30, bv64) := 2188bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2188:l00000b95", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2293bv64)) + LocalAssign(Register(R30, bv64) := 2204bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2204:l00000bae", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R30, bv64) := 2212bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2212:l00000bbd", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2220bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2220:l00000bcb", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)]), 32)) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l00000a5c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000c28", condition()) + ) + ) + Block("1956:l00000c28", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1976:l00000a5c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l00000c3b", condition()) + ) + ) + Block("1976:l00000a5c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l00000c3b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local/gcc/malloc_with_local-before-analysis.il.expected b/src/test/correct/malloc_with_local/gcc/malloc_with_local-before-analysis.il.expected new file mode 100644 index 000000000..257eb9872 --- /dev/null +++ b/src/test/correct/malloc_with_local/gcc/malloc_with_local-before-analysis.il.expected @@ -0,0 +1,399 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("2044:l0000031d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l0000045d", condition()) + ) + ) + Block("2008:l0000045d", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("2032:l0000046b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000484", condition()) + ) + ) + Block("2020:l00000484", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l0000046b", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000477", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l0000031d", condition()) + ) + ) + Block("2044:l0000031d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2224:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2224:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l0000067d", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l00000247", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l00000732", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1860:l0000025d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l000004d4", condition()) + ) + ) + Block("1860:l0000025d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l000004d4", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l000002a2", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l000004b6", condition()) + ) + ) + Block("1896:l000004b6", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1916:l000002a2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l000004c9", condition()) + ) + ) + Block("1916:l000002a2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l000004c9", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2084bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2084:l0000036f", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2096bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2096:l00000383", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 40bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 10bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R1, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R1, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2256bv64)) + LocalAssign(Register(R30, bv64) := 2156bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2156:l000003e7", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2280bv64)) + LocalAssign(Register(R30, bv64) := 2180bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2180:l0000040d", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2296bv64)) + LocalAssign(Register(R30, bv64) := 2196bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2196:l00000426", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R30, bv64) := 2204bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2204:l00000435", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 2212bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2212:l00000443", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l000002de", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000498", condition()) + ) + ) + Block("1956:l00000498", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1976:l000002de", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l000004ab", condition()) + ) + ) + Block("1976:l000002de", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l000004ab", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local/gcc_O2/malloc_with_local-before-analysis.il.expected b/src/test/correct/malloc_with_local/gcc_O2/malloc_with_local-before-analysis.il.expected new file mode 100644 index 000000000..15b26198b --- /dev/null +++ b/src/test/correct/malloc_with_local/gcc_O2/malloc_with_local-before-analysis.il.expected @@ -0,0 +1,348 @@ +Procedure("1552:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("2044:l000003a4", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l000003cd", condition()) + ) + ) + Block("2008:l000003cd", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("2032:l000003db", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l000003f4", condition()) + ) + ) + Block("2020:l000003f4", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1552:__cxa_finalize", condition()) + ) + ) + Block("2032:l000003db", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l000003e7", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l000003a4", condition()) + ) + ) + Block("2044:l000003a4", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1568:__printf_chk", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2068:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1472:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1488bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1488:l000005a1", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__libc_start_main", condition()) + ) + ) + Block("1840:l000002ce", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1600:abort", condition()) + ) + ) + Block("?:l0000062b", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1600:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1860:l000002e4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000444", condition()) + ) + ) + Block("1860:l000002e4", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000444", + statements( + ), + jumps( + GoTo("1584:l__gmon_start__", condition()) + ) + ) + Block("1584:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l00000329", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000426", condition()) + ) + ) + Block("1896:l00000426", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1916:l00000329", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000439", condition()) + ) + ) + Block("1916:l00000329", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000439", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1664:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1664:lmain", + statements( + LocalAssign(LocalVar(#1, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#1, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#1, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#1, bv64)) + LocalAssign(Register(R2, bv64) := 65bv64) + LocalAssign(Register(R1, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2096bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 1692bv64) + ), + jumps( + DirectCall("1568:__printf_chk", condition()) + ) + ) + Block("1692:l00000221", + statements( + LocalAssign(Register(R2, bv64) := 42bv64) + LocalAssign(Register(R1, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2120bv64)) + LocalAssign(Register(R30, bv64) := 1712bv64) + ), + jumps( + DirectCall("1568:__printf_chk", condition()) + ) + ) + Block("1712:l0000023d", + statements( + LocalAssign(Register(R2, bv64) := 10bv64) + LocalAssign(Register(R1, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2136bv64)) + LocalAssign(Register(R30, bv64) := 1732bv64) + ), + jumps( + DirectCall("1568:__printf_chk", condition()) + ) + ) + Block("1732:l00000259", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l00000365", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000408", condition()) + ) + ) + Block("1956:l00000408", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1976:l00000365", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l0000041b", condition()) + ) + ) + Block("1976:l00000365", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l0000041b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local/gcc_no_plt_no_pic/malloc_with_local-before-analysis.il.expected b/src/test/correct/malloc_with_local/gcc_no_plt_no_pic/malloc_with_local-before-analysis.il.expected new file mode 100644 index 000000000..9da011088 --- /dev/null +++ b/src/test/correct/malloc_with_local/gcc_no_plt_no_pic/malloc_with_local-before-analysis.il.expected @@ -0,0 +1,399 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000a6e", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l00000bae", condition()) + ) + ) + Block("2008:l00000bae", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("2032:l00000bbc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000bd5", condition()) + ) + ) + Block("2020:l00000bd5", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l00000bbc", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000bc8", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000a6e", condition()) + ) + ) + Block("2044:l00000a6e", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2224:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2224:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l00000dce", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l00000998", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l00000e83", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1860:l000009ae", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000c25", condition()) + ) + ) + Block("1860:l000009ae", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000c25", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l000009f3", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000c07", condition()) + ) + ) + Block("1896:l00000c07", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1916:l000009f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000c1a", condition()) + ) + ) + Block("1916:l000009f3", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000c1a", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2084bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2084:l00000ac0", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2096bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2096:l00000ad4", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 40bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 10bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R1, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R1, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2256bv64)) + LocalAssign(Register(R30, bv64) := 2156bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2156:l00000b38", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2280bv64)) + LocalAssign(Register(R30, bv64) := 2180bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2180:l00000b5e", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2296bv64)) + LocalAssign(Register(R30, bv64) := 2196bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2196:l00000b77", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R30, bv64) := 2204bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2204:l00000b86", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 2212bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2212:l00000b94", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l00000a2f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000be9", condition()) + ) + ) + Block("1956:l00000be9", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1976:l00000a2f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l00000bfc", condition()) + ) + ) + Block("1976:l00000a2f", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l00000bfc", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local/gcc_pic/malloc_with_local-before-analysis.il.expected b/src/test/correct/malloc_with_local/gcc_pic/malloc_with_local-before-analysis.il.expected new file mode 100644 index 000000000..9da011088 --- /dev/null +++ b/src/test/correct/malloc_with_local/gcc_pic/malloc_with_local-before-analysis.il.expected @@ -0,0 +1,399 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000a6e", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l00000bae", condition()) + ) + ) + Block("2008:l00000bae", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("2032:l00000bbc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000bd5", condition()) + ) + ) + Block("2020:l00000bd5", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l00000bbc", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000bc8", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000a6e", condition()) + ) + ) + Block("2044:l00000a6e", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2224:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2224:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l00000dce", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l00000998", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l00000e83", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1860:l000009ae", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000c25", condition()) + ) + ) + Block("1860:l000009ae", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000c25", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l000009f3", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000c07", condition()) + ) + ) + Block("1896:l00000c07", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1916:l000009f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000c1a", condition()) + ) + ) + Block("1916:l000009f3", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000c1a", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2084bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2084:l00000ac0", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2096bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2096:l00000ad4", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 40bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 10bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R1, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R1, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2256bv64)) + LocalAssign(Register(R30, bv64) := 2156bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2156:l00000b38", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2280bv64)) + LocalAssign(Register(R30, bv64) := 2180bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2180:l00000b5e", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2296bv64)) + LocalAssign(Register(R30, bv64) := 2196bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2196:l00000b77", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R30, bv64) := 2204bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2204:l00000b86", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 2212bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2212:l00000b94", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l00000a2f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000be9", condition()) + ) + ) + Block("1956:l00000be9", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1976:l00000a2f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l00000bfc", condition()) + ) + ) + Block("1976:l00000a2f", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l00000bfc", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local2/clang/malloc_with_local2-before-analysis.il.expected b/src/test/correct/malloc_with_local2/clang/malloc_with_local2-before-analysis.il.expected new file mode 100644 index 000000000..66493eca9 --- /dev/null +++ b/src/test/correct/malloc_with_local2/clang/malloc_with_local2-before-analysis.il.expected @@ -0,0 +1,417 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) + ), + jumps( + GoTo("2044:l0000034d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l000004dd", condition()) + ) + ) + Block("2008:l000004dd", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("2032:l000004eb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000504", condition()) + ) + ) + Block("2020:l00000504", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l000004eb", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l000004f7", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l0000034d", condition()) + ) + ) + Block("2044:l0000034d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2272:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2272:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l000006fd", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l00000277", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l000007be", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1860:l0000028d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000554", condition()) + ) + ) + Block("1860:l0000028d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000554", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l000002d2", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000536", condition()) + ) + ) + Block("1896:l00000536", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1916:l000002d2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000549", condition()) + ) + ) + Block("1916:l000002d2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000549", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551536bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + LocalAssign(Register(R8, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2100bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2100:l000003b5", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)] := Register(R0, bv64))) + LocalAssign(Register(R8, bv64) := 11bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551596bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 4bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R0, bv64))) + LocalAssign(Register(R30, bv64) := 2124bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2124:l000003de", + statements( + LocalAssign(Register(R8, bv64) := Register(R0, bv64)) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Register(R8, bv64))) + LocalAssign(Register(R8, bv64) := 10bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 2148bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2148:l00000407", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) + LocalAssign(Register(R8, bv64) := 9bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) + LocalAssign(Register(R8, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R8, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2296bv64)) + LocalAssign(Register(R30, bv64) := 2204bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2204:l00000465", + statements( + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2313bv64)) + LocalAssign(Register(R30, bv64) := 2224bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2224:l00000485", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2329bv64)) + LocalAssign(Register(R30, bv64) := 2240bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2240:l0000049e", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) + LocalAssign(Register(R30, bv64) := 2248bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2248:l000004ad", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R30, bv64) := 2256bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2256:l000004bb", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 80bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l0000030e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000518", condition()) + ) + ) + Block("1956:l00000518", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1976:l0000030e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l0000052b", condition()) + ) + ) + Block("1976:l0000030e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l0000052b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local2/clang_O2/malloc_with_local2-before-analysis.il.expected b/src/test/correct/malloc_with_local2/clang_O2/malloc_with_local2-before-analysis.il.expected new file mode 100644 index 000000000..425e44c2f --- /dev/null +++ b/src/test/correct/malloc_with_local2/clang_O2/malloc_with_local2-before-analysis.il.expected @@ -0,0 +1,345 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000036a", condition()) + ) + ) + Block("1816:l0000036a", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1840:l00000378", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000391", condition()) + ) + ) + Block("1828:l00000391", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000378", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000384", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002c5", condition()) + ) + ) + Block("1852:l000002c5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1944:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1464:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1480bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1480:l0000059b", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001ef", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l00000632", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003e1", condition()) + ) + ) + Block("1668:l00000205", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003e1", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003c3", condition()) + ) + ) + Block("1704:l000003c3", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003d6", condition()) + ) + ) + Block("1724:l0000024a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003d6", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1968bv64)) + LocalAssign(Register(R1, bv64) := 65bv64) + LocalAssign(Register(R30, bv64) := 1900bv64) + ), + jumps( + DirectCall("1584:printf", condition()) + ) + ) + Block("1900:l00000322", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1985bv64)) + LocalAssign(Register(R1, bv64) := 42bv64) + LocalAssign(Register(R30, bv64) := 1916bv64) + ), + jumps( + DirectCall("1584:printf", condition()) + ) + ) + Block("1916:l00000339", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2001bv64)) + LocalAssign(Register(R1, bv64) := 10bv64) + LocalAssign(Register(R30, bv64) := 1932bv64) + ), + jumps( + DirectCall("1584:printf", condition()) + ) + ) + Block("1932:l00000350", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1584:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003a5", condition()) + ) + ) + Block("1764:l000003a5", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003b8", condition()) + ) + ) + Block("1784:l00000286", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003b8", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local2/clang_no_plt_no_pic/malloc_with_local2-before-analysis.il.expected b/src/test/correct/malloc_with_local2/clang_no_plt_no_pic/malloc_with_local2-before-analysis.il.expected new file mode 100644 index 000000000..f6024c5e8 --- /dev/null +++ b/src/test/correct/malloc_with_local2/clang_no_plt_no_pic/malloc_with_local2-before-analysis.il.expected @@ -0,0 +1,417 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000b2a", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l00000cba", condition()) + ) + ) + Block("2008:l00000cba", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("2032:l00000cc8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000ce1", condition()) + ) + ) + Block("2020:l00000ce1", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l00000cc8", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000cd4", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000b2a", condition()) + ) + ) + Block("2044:l00000b2a", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2272:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2272:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l00000eda", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l00000a54", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l00000f9b", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1860:l00000a6a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000d31", condition()) + ) + ) + Block("1860:l00000a6a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000d31", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l00000aaf", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000d13", condition()) + ) + ) + Block("1896:l00000d13", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1916:l00000aaf", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000d26", condition()) + ) + ) + Block("1916:l00000aaf", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000d26", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551536bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + LocalAssign(Register(R8, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2100bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2100:l00000b92", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)] := Register(R0, bv64))) + LocalAssign(Register(R8, bv64) := 11bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551596bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 4bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R0, bv64))) + LocalAssign(Register(R30, bv64) := 2124bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2124:l00000bbb", + statements( + LocalAssign(Register(R8, bv64) := Register(R0, bv64)) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Register(R8, bv64))) + LocalAssign(Register(R8, bv64) := 10bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 2148bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2148:l00000be4", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) + LocalAssign(Register(R8, bv64) := 9bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) + LocalAssign(Register(R8, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R8, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2296bv64)) + LocalAssign(Register(R30, bv64) := 2204bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2204:l00000c42", + statements( + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2313bv64)) + LocalAssign(Register(R30, bv64) := 2224bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2224:l00000c62", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2329bv64)) + LocalAssign(Register(R30, bv64) := 2240bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2240:l00000c7b", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) + LocalAssign(Register(R30, bv64) := 2248bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2248:l00000c8a", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R30, bv64) := 2256bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2256:l00000c98", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 80bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l00000aeb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000cf5", condition()) + ) + ) + Block("1956:l00000cf5", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1976:l00000aeb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l00000d08", condition()) + ) + ) + Block("1976:l00000aeb", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l00000d08", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local2/clang_pic/malloc_with_local2-before-analysis.il.expected b/src/test/correct/malloc_with_local2/clang_pic/malloc_with_local2-before-analysis.il.expected new file mode 100644 index 000000000..f6024c5e8 --- /dev/null +++ b/src/test/correct/malloc_with_local2/clang_pic/malloc_with_local2-before-analysis.il.expected @@ -0,0 +1,417 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000b2a", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l00000cba", condition()) + ) + ) + Block("2008:l00000cba", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("2032:l00000cc8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000ce1", condition()) + ) + ) + Block("2020:l00000ce1", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l00000cc8", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000cd4", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000b2a", condition()) + ) + ) + Block("2044:l00000b2a", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2272:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2272:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l00000eda", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l00000a54", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l00000f9b", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1860:l00000a6a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000d31", condition()) + ) + ) + Block("1860:l00000a6a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000d31", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l00000aaf", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000d13", condition()) + ) + ) + Block("1896:l00000d13", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1916:l00000aaf", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000d26", condition()) + ) + ) + Block("1916:l00000aaf", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000d26", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551536bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + LocalAssign(Register(R8, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2100bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2100:l00000b92", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)] := Register(R0, bv64))) + LocalAssign(Register(R8, bv64) := 11bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551596bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 4bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R0, bv64))) + LocalAssign(Register(R30, bv64) := 2124bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2124:l00000bbb", + statements( + LocalAssign(Register(R8, bv64) := Register(R0, bv64)) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Register(R8, bv64))) + LocalAssign(Register(R8, bv64) := 10bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 2148bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2148:l00000be4", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) + LocalAssign(Register(R8, bv64) := 9bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) + LocalAssign(Register(R8, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R8, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2296bv64)) + LocalAssign(Register(R30, bv64) := 2204bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2204:l00000c42", + statements( + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2313bv64)) + LocalAssign(Register(R30, bv64) := 2224bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2224:l00000c62", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2329bv64)) + LocalAssign(Register(R30, bv64) := 2240bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2240:l00000c7b", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) + LocalAssign(Register(R30, bv64) := 2248bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2248:l00000c8a", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R30, bv64) := 2256bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2256:l00000c98", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 80bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l00000aeb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000cf5", condition()) + ) + ) + Block("1956:l00000cf5", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1976:l00000aeb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l00000d08", condition()) + ) + ) + Block("1976:l00000aeb", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l00000d08", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local2/gcc/malloc_with_local2-before-analysis.il.expected b/src/test/correct/malloc_with_local2/gcc/malloc_with_local2-before-analysis.il.expected new file mode 100644 index 000000000..8d4b8dfe7 --- /dev/null +++ b/src/test/correct/malloc_with_local2/gcc/malloc_with_local2-before-analysis.il.expected @@ -0,0 +1,413 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000339", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l000004a7", condition()) + ) + ) + Block("2008:l000004a7", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("2032:l000004b5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l000004ce", condition()) + ) + ) + Block("2020:l000004ce", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l000004b5", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l000004c1", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000339", condition()) + ) + ) + Block("2044:l00000339", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2252:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2252:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l000006c7", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l00000263", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l00000783", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1860:l00000279", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l0000051e", condition()) + ) + ) + Block("1860:l00000279", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l0000051e", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000500", condition()) + ) + ) + Block("1896:l00000500", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1916:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000513", condition()) + ) + ) + Block("1916:l000002be", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000513", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551552bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2084bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2084:l0000038b", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 40bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 11bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2104bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2104:l000003ac", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 48bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 10bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2124bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2124:l000003cd", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 56bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 9bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 36bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R1, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) + LocalAssign(Register(R1, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2280bv64)) + LocalAssign(Register(R30, bv64) := 2184bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2184:l00000431", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2304bv64)) + LocalAssign(Register(R30, bv64) := 2208bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2208:l00000457", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2320bv64)) + LocalAssign(Register(R30, bv64) := 2224bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2224:l00000470", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 2232bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2232:l0000047f", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) + LocalAssign(Register(R30, bv64) := 2240bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2240:l0000048d", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l000002fa", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l000004e2", condition()) + ) + ) + Block("1956:l000004e2", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1976:l000002fa", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l000004f5", condition()) + ) + ) + Block("1976:l000002fa", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l000004f5", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local2/gcc_O2/malloc_with_local2-before-analysis.il.expected b/src/test/correct/malloc_with_local2/gcc_O2/malloc_with_local2-before-analysis.il.expected new file mode 100644 index 000000000..15b26198b --- /dev/null +++ b/src/test/correct/malloc_with_local2/gcc_O2/malloc_with_local2-before-analysis.il.expected @@ -0,0 +1,348 @@ +Procedure("1552:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("2044:l000003a4", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l000003cd", condition()) + ) + ) + Block("2008:l000003cd", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("2032:l000003db", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l000003f4", condition()) + ) + ) + Block("2020:l000003f4", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1552:__cxa_finalize", condition()) + ) + ) + Block("2032:l000003db", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l000003e7", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l000003a4", condition()) + ) + ) + Block("2044:l000003a4", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1568:__printf_chk", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2068:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1472:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1488bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1488:l000005a1", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__libc_start_main", condition()) + ) + ) + Block("1840:l000002ce", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1600:abort", condition()) + ) + ) + Block("?:l0000062b", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1600:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1860:l000002e4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000444", condition()) + ) + ) + Block("1860:l000002e4", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000444", + statements( + ), + jumps( + GoTo("1584:l__gmon_start__", condition()) + ) + ) + Block("1584:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l00000329", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000426", condition()) + ) + ) + Block("1896:l00000426", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1916:l00000329", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000439", condition()) + ) + ) + Block("1916:l00000329", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000439", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1664:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1664:lmain", + statements( + LocalAssign(LocalVar(#1, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#1, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#1, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#1, bv64)) + LocalAssign(Register(R2, bv64) := 65bv64) + LocalAssign(Register(R1, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2096bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 1692bv64) + ), + jumps( + DirectCall("1568:__printf_chk", condition()) + ) + ) + Block("1692:l00000221", + statements( + LocalAssign(Register(R2, bv64) := 42bv64) + LocalAssign(Register(R1, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2120bv64)) + LocalAssign(Register(R30, bv64) := 1712bv64) + ), + jumps( + DirectCall("1568:__printf_chk", condition()) + ) + ) + Block("1712:l0000023d", + statements( + LocalAssign(Register(R2, bv64) := 10bv64) + LocalAssign(Register(R1, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2136bv64)) + LocalAssign(Register(R30, bv64) := 1732bv64) + ), + jumps( + DirectCall("1568:__printf_chk", condition()) + ) + ) + Block("1732:l00000259", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l00000365", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000408", condition()) + ) + ) + Block("1956:l00000408", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1976:l00000365", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l0000041b", condition()) + ) + ) + Block("1976:l00000365", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l0000041b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local2/gcc_no_plt_no_pic/malloc_with_local2-before-analysis.il.expected b/src/test/correct/malloc_with_local2/gcc_no_plt_no_pic/malloc_with_local2-before-analysis.il.expected new file mode 100644 index 000000000..596f8d8f9 --- /dev/null +++ b/src/test/correct/malloc_with_local2/gcc_no_plt_no_pic/malloc_with_local2-before-analysis.il.expected @@ -0,0 +1,413 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000adb", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l00000c49", condition()) + ) + ) + Block("2008:l00000c49", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("2032:l00000c57", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000c70", condition()) + ) + ) + Block("2020:l00000c70", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l00000c57", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000c63", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000adb", condition()) + ) + ) + Block("2044:l00000adb", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2252:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2252:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l00000e69", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l00000a05", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l00000f25", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1860:l00000a1b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000cc0", condition()) + ) + ) + Block("1860:l00000a1b", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000cc0", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l00000a60", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000ca2", condition()) + ) + ) + Block("1896:l00000ca2", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1916:l00000a60", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000cb5", condition()) + ) + ) + Block("1916:l00000a60", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000cb5", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551552bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2084bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2084:l00000b2d", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 40bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 11bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2104bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2104:l00000b4e", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 48bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 10bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2124bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2124:l00000b6f", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 56bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 9bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 36bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R1, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) + LocalAssign(Register(R1, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2280bv64)) + LocalAssign(Register(R30, bv64) := 2184bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2184:l00000bd3", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2304bv64)) + LocalAssign(Register(R30, bv64) := 2208bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2208:l00000bf9", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2320bv64)) + LocalAssign(Register(R30, bv64) := 2224bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2224:l00000c12", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 2232bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2232:l00000c21", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) + LocalAssign(Register(R30, bv64) := 2240bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2240:l00000c2f", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l00000a9c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000c84", condition()) + ) + ) + Block("1956:l00000c84", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1976:l00000a9c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l00000c97", condition()) + ) + ) + Block("1976:l00000a9c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l00000c97", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local2/gcc_pic/malloc_with_local2-before-analysis.il.expected b/src/test/correct/malloc_with_local2/gcc_pic/malloc_with_local2-before-analysis.il.expected new file mode 100644 index 000000000..596f8d8f9 --- /dev/null +++ b/src/test/correct/malloc_with_local2/gcc_pic/malloc_with_local2-before-analysis.il.expected @@ -0,0 +1,413 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000adb", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l00000c49", condition()) + ) + ) + Block("2008:l00000c49", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("2032:l00000c57", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000c70", condition()) + ) + ) + Block("2020:l00000c70", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l00000c57", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000c63", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000adb", condition()) + ) + ) + Block("2044:l00000adb", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2252:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2252:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l00000e69", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l00000a05", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l00000f25", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1860:l00000a1b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000cc0", condition()) + ) + ) + Block("1860:l00000a1b", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000cc0", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l00000a60", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000ca2", condition()) + ) + ) + Block("1896:l00000ca2", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1916:l00000a60", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000cb5", condition()) + ) + ) + Block("1916:l00000a60", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000cb5", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551552bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2084bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2084:l00000b2d", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 40bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 11bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2104bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2104:l00000b4e", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 48bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 10bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2124bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2124:l00000b6f", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 56bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 9bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 36bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R1, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) + LocalAssign(Register(R1, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2280bv64)) + LocalAssign(Register(R30, bv64) := 2184bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2184:l00000bd3", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2304bv64)) + LocalAssign(Register(R30, bv64) := 2208bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2208:l00000bf9", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2320bv64)) + LocalAssign(Register(R30, bv64) := 2224bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2224:l00000c12", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 2232bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2232:l00000c21", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) + LocalAssign(Register(R30, bv64) := 2240bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2240:l00000c2f", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l00000a9c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000c84", condition()) + ) + ) + Block("1956:l00000c84", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1976:l00000a9c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l00000c97", condition()) + ) + ) + Block("1976:l00000a9c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l00000c97", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local3/clang/malloc_with_local3-before-analysis.il.expected b/src/test/correct/malloc_with_local3/clang/malloc_with_local3-before-analysis.il.expected new file mode 100644 index 000000000..c5432b8cd --- /dev/null +++ b/src/test/correct/malloc_with_local3/clang/malloc_with_local3-before-analysis.il.expected @@ -0,0 +1,449 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000381", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l0000057c", condition()) + ) + ) + Block("2008:l0000057c", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("2032:l0000058a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l000005a3", condition()) + ) + ) + Block("2020:l000005a3", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l0000058a", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000596", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000381", condition()) + ) + ) + Block("2044:l00000381", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2324:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2324:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#9, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#9, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#9, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#9, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l0000079c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l000002ab", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l0000086a", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1860:l000002c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l000005f3", condition()) + ) + ) + Block("1860:l000002c1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l000005f3", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l00000306", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l000005d5", condition()) + ) + ) + Block("1896:l000005d5", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1916:l00000306", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l000005e8", condition()) + ) + ) + Block("1916:l00000306", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l000005e8", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551536bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + LocalAssign(Register(R8, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2100bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2100:l000003e9", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)] := Register(R0, bv64))) + LocalAssign(Register(R8, bv64) := 11bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551596bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 4bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R0, bv64))) + LocalAssign(Register(R30, bv64) := 2124bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2124:l00000412", + statements( + LocalAssign(Register(R8, bv64) := Register(R0, bv64)) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Register(R8, bv64))) + LocalAssign(Register(R8, bv64) := 10bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 2148bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2148:l0000043b", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) + LocalAssign(Register(R8, bv64) := 9bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) + LocalAssign(Register(R8, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R8, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) + LocalAssign(Register(R30, bv64) := 2192bv64) + ), + jumps( + DirectCall("2260:printCharValue", condition()) + ) + ) + Block("2192:l00000504", + statements( + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2348bv64)) + LocalAssign(Register(R30, bv64) := 2212bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2212:l00000524", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2364bv64)) + LocalAssign(Register(R30, bv64) := 2228bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2228:l0000053d", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) + LocalAssign(Register(R30, bv64) := 2236bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2236:l0000054c", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R30, bv64) := 2244bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2244:l0000055a", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#7, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#7, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 80bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2260:printCharValue", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2260:lprintCharValue", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R9, bv64)]), 56)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2391bv64)) + LocalAssign(Register(R30, bv64) := 2312bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2312:l000004e9", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#6, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#6, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l00000342", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l000005b7", condition()) + ) + ) + Block("1956:l000005b7", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1976:l00000342", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l000005ca", condition()) + ) + ) + Block("1976:l00000342", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l000005ca", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local3/clang_O2/malloc_with_local3-before-analysis.il.expected b/src/test/correct/malloc_with_local3/clang_O2/malloc_with_local3-before-analysis.il.expected new file mode 100644 index 000000000..0a18ea07a --- /dev/null +++ b/src/test/correct/malloc_with_local3/clang_O2/malloc_with_local3-before-analysis.il.expected @@ -0,0 +1,361 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002e5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000003ba", condition()) + ) + ) + Block("1816:l000003ba", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1840:l000003c8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l000003e1", condition()) + ) + ) + Block("1828:l000003e1", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l000003c8", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000003d4", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002e5", condition()) + ) + ) + Block("1852:l000002e5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1976:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1976:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1464:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1480bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1480:l000005f3", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l0000020f", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l00000692", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l00000225", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000431", condition()) + ) + ) + Block("1668:l00000225", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000431", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000026a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000413", condition()) + ) + ) + Block("1704:l00000413", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1724:l0000026a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000426", condition()) + ) + ) + Block("1724:l0000026a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000426", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2043bv64)) + LocalAssign(Register(R1, bv64) := 66bv64) + LocalAssign(Register(R30, bv64) := 1900bv64) + ), + jumps( + DirectCall("1584:printf", condition()) + ) + ) + Block("1900:l00000342", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2000bv64)) + LocalAssign(Register(R1, bv64) := 42bv64) + LocalAssign(Register(R30, bv64) := 1916bv64) + ), + jumps( + DirectCall("1584:printf", condition()) + ) + ) + Block("1916:l00000359", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2016bv64)) + LocalAssign(Register(R1, bv64) := 10bv64) + LocalAssign(Register(R30, bv64) := 1932bv64) + ), + jumps( + DirectCall("1584:printf", condition()) + ) + ) + Block("1932:l00000370", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1944:printCharValue", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1944:lprintCharValue", + statements( + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + LocalAssign(Register(R8, bv64) := Register(R0, bv64)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2043bv64)) + LocalAssign(Register(R9, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R9, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("++", 0bv24, Extract(Register(R9, bv64)[8:0])), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R9, bv64)[8:0]))) + ), + jumps( + DirectCall("1584:printf", condition()) + ) + ) +)), +Procedure("1584:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002a6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003f5", condition()) + ) + ) + Block("1764:l000003f5", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l000002a6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000408", condition()) + ) + ) + Block("1784:l000002a6", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000408", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local3/clang_no_plt_no_pic/malloc_with_local3-before-analysis.il.expected b/src/test/correct/malloc_with_local3/clang_no_plt_no_pic/malloc_with_local3-before-analysis.il.expected new file mode 100644 index 000000000..93aaab4fc --- /dev/null +++ b/src/test/correct/malloc_with_local3/clang_no_plt_no_pic/malloc_with_local3-before-analysis.il.expected @@ -0,0 +1,449 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000c0c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l00000e07", condition()) + ) + ) + Block("2008:l00000e07", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("2032:l00000e15", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000e2e", condition()) + ) + ) + Block("2020:l00000e2e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l00000e15", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000e21", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000c0c", condition()) + ) + ) + Block("2044:l00000c0c", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2324:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2324:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#9, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#9, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#9, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#9, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l00001027", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l00000b36", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l000010f5", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1860:l00000b4c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000e7e", condition()) + ) + ) + Block("1860:l00000b4c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000e7e", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l00000b91", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000e60", condition()) + ) + ) + Block("1896:l00000e60", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1916:l00000b91", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000e73", condition()) + ) + ) + Block("1916:l00000b91", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000e73", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551536bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + LocalAssign(Register(R8, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2100bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2100:l00000c74", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)] := Register(R0, bv64))) + LocalAssign(Register(R8, bv64) := 11bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551596bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 4bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R0, bv64))) + LocalAssign(Register(R30, bv64) := 2124bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2124:l00000c9d", + statements( + LocalAssign(Register(R8, bv64) := Register(R0, bv64)) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Register(R8, bv64))) + LocalAssign(Register(R8, bv64) := 10bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 2148bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2148:l00000cc6", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) + LocalAssign(Register(R8, bv64) := 9bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) + LocalAssign(Register(R8, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R8, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) + LocalAssign(Register(R30, bv64) := 2192bv64) + ), + jumps( + DirectCall("2260:printCharValue", condition()) + ) + ) + Block("2192:l00000d8f", + statements( + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2348bv64)) + LocalAssign(Register(R30, bv64) := 2212bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2212:l00000daf", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2364bv64)) + LocalAssign(Register(R30, bv64) := 2228bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2228:l00000dc8", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) + LocalAssign(Register(R30, bv64) := 2236bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2236:l00000dd7", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R30, bv64) := 2244bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2244:l00000de5", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#7, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#7, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 80bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2260:printCharValue", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2260:lprintCharValue", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R9, bv64)]), 56)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2391bv64)) + LocalAssign(Register(R30, bv64) := 2312bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2312:l00000d74", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#6, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#6, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l00000bcd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000e42", condition()) + ) + ) + Block("1956:l00000e42", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1976:l00000bcd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l00000e55", condition()) + ) + ) + Block("1976:l00000bcd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l00000e55", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local3/clang_pic/malloc_with_local3-before-analysis.il.expected b/src/test/correct/malloc_with_local3/clang_pic/malloc_with_local3-before-analysis.il.expected new file mode 100644 index 000000000..93aaab4fc --- /dev/null +++ b/src/test/correct/malloc_with_local3/clang_pic/malloc_with_local3-before-analysis.il.expected @@ -0,0 +1,449 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000c0c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l00000e07", condition()) + ) + ) + Block("2008:l00000e07", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("2032:l00000e15", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000e2e", condition()) + ) + ) + Block("2020:l00000e2e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l00000e15", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000e21", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000c0c", condition()) + ) + ) + Block("2044:l00000c0c", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2324:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2324:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#9, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#9, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#9, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#9, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l00001027", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l00000b36", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l000010f5", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1860:l00000b4c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000e7e", condition()) + ) + ) + Block("1860:l00000b4c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000e7e", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l00000b91", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000e60", condition()) + ) + ) + Block("1896:l00000e60", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1916:l00000b91", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000e73", condition()) + ) + ) + Block("1916:l00000b91", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000e73", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551536bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + LocalAssign(Register(R8, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2100bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2100:l00000c74", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)] := Register(R0, bv64))) + LocalAssign(Register(R8, bv64) := 11bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551596bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 4bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R0, bv64))) + LocalAssign(Register(R30, bv64) := 2124bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2124:l00000c9d", + statements( + LocalAssign(Register(R8, bv64) := Register(R0, bv64)) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Register(R8, bv64))) + LocalAssign(Register(R8, bv64) := 10bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R30, bv64) := 2148bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2148:l00000cc6", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) + LocalAssign(Register(R8, bv64) := 9bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) + LocalAssign(Register(R8, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R8, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) + LocalAssign(Register(R30, bv64) := 2192bv64) + ), + jumps( + DirectCall("2260:printCharValue", condition()) + ) + ) + Block("2192:l00000d8f", + statements( + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2348bv64)) + LocalAssign(Register(R30, bv64) := 2212bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2212:l00000daf", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2364bv64)) + LocalAssign(Register(R30, bv64) := 2228bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2228:l00000dc8", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) + LocalAssign(Register(R30, bv64) := 2236bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2236:l00000dd7", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) + LocalAssign(Register(R30, bv64) := 2244bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2244:l00000de5", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#7, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#7, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 80bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2260:printCharValue", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2260:lprintCharValue", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R9, bv64)]), 56)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2391bv64)) + LocalAssign(Register(R30, bv64) := 2312bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2312:l00000d74", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#6, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#6, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l00000bcd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000e42", condition()) + ) + ) + Block("1956:l00000e42", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1976:l00000bcd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l00000e55", condition()) + ) + ) + Block("1976:l00000bcd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l00000e55", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local3/gcc/malloc_with_local3-before-analysis.il.expected b/src/test/correct/malloc_with_local3/gcc/malloc_with_local3-before-analysis.il.expected new file mode 100644 index 000000000..22a6a3c0f --- /dev/null +++ b/src/test/correct/malloc_with_local3/gcc/malloc_with_local3-before-analysis.il.expected @@ -0,0 +1,446 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000371", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l00000551", condition()) + ) + ) + Block("2008:l00000551", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("2032:l0000055f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000578", condition()) + ) + ) + Block("2020:l00000578", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l0000055f", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l0000056b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000371", condition()) + ) + ) + Block("2044:l00000371", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2308:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2308:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l00000771", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l0000029b", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l0000083b", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1860:l000002b1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l000005c8", condition()) + ) + ) + Block("1860:l000002b1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l000005c8", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l000002f6", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l000005aa", condition()) + ) + ) + Block("1896:l000005aa", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1916:l000002f6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l000005bd", condition()) + ) + ) + Block("1916:l000002f6", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l000005bd", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551552bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2084bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2084:l000003c3", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 40bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 11bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2104bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2104:l000003e4", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 48bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 10bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2124bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2124:l00000405", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 56bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 9bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 36bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R1, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) + LocalAssign(Register(R1, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 2168bv64) + ), + jumps( + DirectCall("2236:printCharValue", condition()) + ) + ) + Block("2168:l000004db", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2336bv64)) + LocalAssign(Register(R30, bv64) := 2192bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2192:l00000501", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2352bv64)) + LocalAssign(Register(R30, bv64) := 2208bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2208:l0000051a", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 2216bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2216:l00000529", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) + LocalAssign(Register(R30, bv64) := 2224bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2224:l00000537", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2236:printCharValue", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2236:lprintCharValue", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("++", 0bv24, Extract(Register(R0, bv64)[8:0])), 32)) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2384bv64)) + LocalAssign(Register(R30, bv64) := 2296bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2296:l000004c4", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l00000332", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l0000058c", condition()) + ) + ) + Block("1956:l0000058c", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1976:l00000332", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l0000059f", condition()) + ) + ) + Block("1976:l00000332", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l0000059f", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local3/gcc_O2/malloc_with_local3-before-analysis.il.expected b/src/test/correct/malloc_with_local3/gcc_O2/malloc_with_local3-before-analysis.il.expected new file mode 100644 index 000000000..7db80fa42 --- /dev/null +++ b/src/test/correct/malloc_with_local3/gcc_O2/malloc_with_local3-before-analysis.il.expected @@ -0,0 +1,388 @@ +Procedure("1664:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2112:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2112:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("2172:l00000428", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2136:l00000457", condition()) + ) + ) + Block("2136:l00000457", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("2160:l00000465", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2148:l0000047e", condition()) + ) + ) + Block("2148:l0000047e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2160bv64) + ), + jumps( + DirectCall("1664:__cxa_finalize", condition()) + ) + ) + Block("2160:l00000465", + statements( + LocalAssign(Register(R30, bv64) := 2164bv64) + ), + jumps( + DirectCall("2000:deregister_tm_clones", condition()) + ) + ) + Block("2164:l00000471", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2172:l00000428", condition()) + ) + ) + Block("2172:l00000428", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1648:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1648:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1696:__printf_chk", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2244:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2244:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1584:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1584:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1600bv64) + ), + jumps( + DirectCall("1972:call_weak_fn", condition()) + ) + ) + Block("1600:l00000677", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1920:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1968bv64) + ), + jumps( + DirectCall("1648:__libc_start_main", condition()) + ) + ) + Block("1968:l00000352", + statements( + LocalAssign(Register(R30, bv64) := 1972bv64) + ), + jumps( + DirectCall("1728:abort", condition()) + ) + ) + Block("?:l0000070d", + statements( + ), + jumps( + DirectCall("1972:call_weak_fn", condition()) + ) + ) +)), +Procedure("1728:abort", in(), out(), blocks( +)), +Procedure("1972:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1972:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1988:l00000368", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1984:l000004ce", condition()) + ) + ) + Block("1988:l00000368", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1984:l000004ce", + statements( + ), + jumps( + GoTo("1712:l__gmon_start__", condition()) + ) + ) + Block("1712:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2000:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2000:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("2044:l000003ad", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("2024:l000004b0", condition()) + ) + ) + Block("2024:l000004b0", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("2044:l000003ad", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("2036:l000004c3", condition()) + ) + ) + Block("2044:l000003ad", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("2036:l000004c3", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2192:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2192:lframe_dummy", + statements( + ), + jumps( + DirectCall("2048:register_tm_clones", condition()) + ) + ) +)), +Procedure("1744:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1792:lmain", + statements( + LocalAssign(LocalVar(#1, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#1, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#1, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#1, bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R30, bv64) := 1812bv64) + ), + jumps( + DirectCall("1680:malloc", condition()) + ) + ) + Block("1812:l00000249", + statements( + LocalAssign(Register(R1, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R19, bv64) := Register(R0, bv64)) + LocalAssign(Register(R30, bv64) := 1828bv64) + ), + jumps( + DirectCall("2208:printCharValue", condition()) + ) + ) + Block("1828:l0000029a", + statements( + LocalAssign(Register(R2, bv64) := 42bv64) + LocalAssign(Register(R1, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2296bv64)) + LocalAssign(Register(R30, bv64) := 1848bv64) + ), + jumps( + DirectCall("1696:__printf_chk", condition()) + ) + ) + Block("1848:l000002b6", + statements( + LocalAssign(Register(R1, bv64) := 0bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2312bv64)) + LocalAssign(Register(R2, bv64) := 10bv64) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 1868bv64) + ), + jumps( + DirectCall("1696:__printf_chk", condition()) + ) + ) + Block("1868:l000002d2", + statements( + LocalAssign(Register(R0, bv64) := Register(R19, bv64)) + LocalAssign(Register(R30, bv64) := 1876bv64) + ), + jumps( + DirectCall("1744:#free", condition()) + ) + ) + Block("1876:l000002e0", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1680:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2208:printCharValue", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2208:lprintCharValue", + statements( + LocalAssign(Register(R3, bv64) := Register(R0, bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R1, bv64) := 0bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2272bv64)) + LocalAssign(Register(R2, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R3, bv64)]), 56)) + LocalAssign(Register(R2, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R2, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) + LocalAssign(Register(R2, bv64) := ZeroExtend(BinaryExpr("++", 0bv24, Extract(Register(R2, bv64)[8:0])), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R3, bv64)] := Extract(Register(R2, bv64)[8:0]))) + ), + jumps( + DirectCall("1696:__printf_chk", condition()) + ) + ) +)), +Procedure("2048:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2048:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("2104:l000003e9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("2084:l00000492", condition()) + ) + ) + Block("2084:l00000492", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("2104:l000003e9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("2096:l000004a5", condition()) + ) + ) + Block("2104:l000003e9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("2096:l000004a5", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local3/gcc_no_plt_no_pic/malloc_with_local3-before-analysis.il.expected b/src/test/correct/malloc_with_local3/gcc_no_plt_no_pic/malloc_with_local3-before-analysis.il.expected new file mode 100644 index 000000000..770b4011e --- /dev/null +++ b/src/test/correct/malloc_with_local3/gcc_no_plt_no_pic/malloc_with_local3-before-analysis.il.expected @@ -0,0 +1,446 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000bcd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l00000dad", condition()) + ) + ) + Block("2008:l00000dad", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("2032:l00000dbb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000dd4", condition()) + ) + ) + Block("2020:l00000dd4", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l00000dbb", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000dc7", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000bcd", condition()) + ) + ) + Block("2044:l00000bcd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2308:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2308:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l00000fcd", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l00000af7", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l00001097", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1860:l00000b0d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000e24", condition()) + ) + ) + Block("1860:l00000b0d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000e24", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l00000b52", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000e06", condition()) + ) + ) + Block("1896:l00000e06", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1916:l00000b52", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000e19", condition()) + ) + ) + Block("1916:l00000b52", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000e19", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551552bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2084bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2084:l00000c1f", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 40bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 11bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2104bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2104:l00000c40", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 48bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 10bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2124bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2124:l00000c61", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 56bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 9bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 36bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R1, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) + LocalAssign(Register(R1, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 2168bv64) + ), + jumps( + DirectCall("2236:printCharValue", condition()) + ) + ) + Block("2168:l00000d37", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2336bv64)) + LocalAssign(Register(R30, bv64) := 2192bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2192:l00000d5d", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2352bv64)) + LocalAssign(Register(R30, bv64) := 2208bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2208:l00000d76", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 2216bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2216:l00000d85", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) + LocalAssign(Register(R30, bv64) := 2224bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2224:l00000d93", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2236:printCharValue", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2236:lprintCharValue", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("++", 0bv24, Extract(Register(R0, bv64)[8:0])), 32)) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2384bv64)) + LocalAssign(Register(R30, bv64) := 2296bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2296:l00000d20", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l00000b8e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000de8", condition()) + ) + ) + Block("1956:l00000de8", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1976:l00000b8e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l00000dfb", condition()) + ) + ) + Block("1976:l00000b8e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l00000dfb", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/malloc_with_local3/gcc_pic/malloc_with_local3-before-analysis.il.expected b/src/test/correct/malloc_with_local3/gcc_pic/malloc_with_local3-before-analysis.il.expected new file mode 100644 index 000000000..770b4011e --- /dev/null +++ b/src/test/correct/malloc_with_local3/gcc_pic/malloc_with_local3-before-analysis.il.expected @@ -0,0 +1,446 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000bcd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l00000dad", condition()) + ) + ) + Block("2008:l00000dad", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("2032:l00000dbb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000dd4", condition()) + ) + ) + Block("2020:l00000dd4", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l00000dbb", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000dc7", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000bcd", condition()) + ) + ) + Block("2044:l00000bcd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2308:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2308:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l00000fcd", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l00000af7", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l00001097", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1860:l00000b0d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000e24", condition()) + ) + ) + Block("1860:l00000b0d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000e24", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l00000b52", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000e06", condition()) + ) + ) + Block("1896:l00000e06", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1916:l00000b52", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000e19", condition()) + ) + ) + Block("1916:l00000b52", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000e19", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551552bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2084bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2084:l00000c1f", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 40bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 11bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2104bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2104:l00000c40", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 48bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 10bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2124bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2124:l00000c61", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 56bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 9bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 36bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R1, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) + LocalAssign(Register(R1, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 2168bv64) + ), + jumps( + DirectCall("2236:printCharValue", condition()) + ) + ) + Block("2168:l00000d37", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2336bv64)) + LocalAssign(Register(R30, bv64) := 2192bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2192:l00000d5d", + statements( + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2352bv64)) + LocalAssign(Register(R30, bv64) := 2208bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2208:l00000d76", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 2216bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2216:l00000d85", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) + LocalAssign(Register(R30, bv64) := 2224bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2224:l00000d93", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2236:printCharValue", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2236:lprintCharValue", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("++", 0bv24, Extract(Register(R0, bv64)[8:0])), 32)) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2384bv64)) + LocalAssign(Register(R30, bv64) := 2296bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2296:l00000d20", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l00000b8e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000de8", condition()) + ) + ) + Block("1956:l00000de8", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1976:l00000b8e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l00000dfb", condition()) + ) + ) + Block("1976:l00000b8e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l00000dfb", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/multi_malloc/clang/multi_malloc-before-analysis.il.expected b/src/test/correct/multi_malloc/clang/multi_malloc-before-analysis.il.expected new file mode 100644 index 000000000..93011469c --- /dev/null +++ b/src/test/correct/multi_malloc/clang/multi_malloc-before-analysis.il.expected @@ -0,0 +1,388 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000311", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l0000043d", condition()) + ) + ) + Block("2008:l0000043d", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("2032:l0000044b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000464", condition()) + ) + ) + Block("2020:l00000464", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l0000044b", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000457", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000311", condition()) + ) + ) + Block("2044:l00000311", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2212:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2212:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l0000065d", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l0000023b", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l0000070f", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1860:l00000251", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l000004b4", condition()) + ) + ) + Block("1860:l00000251", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l000004b4", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000496", condition()) + ) + ) + Block("1896:l00000496", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1916:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l000004a9", condition()) + ) + ) + Block("1916:l00000296", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l000004a9", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + LocalAssign(Register(R8, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2100bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2100:l00000379", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2112bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2112:l0000038d", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R8, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R8, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2236bv64)) + LocalAssign(Register(R30, bv64) := 2160bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2160:l000003de", + statements( + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2253bv64)) + LocalAssign(Register(R30, bv64) := 2180bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2180:l000003fe", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R30, bv64) := 2188bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2188:l0000040d", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2196bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2196:l0000041b", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l000002d2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000478", condition()) + ) + ) + Block("1956:l00000478", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1976:l000002d2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l0000048b", condition()) + ) + ) + Block("1976:l000002d2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l0000048b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/multi_malloc/clang_O2/multi_malloc-before-analysis.il.expected b/src/test/correct/multi_malloc/clang_O2/multi_malloc-before-analysis.il.expected new file mode 100644 index 000000000..a112bb316 --- /dev/null +++ b/src/test/correct/multi_malloc/clang_O2/multi_malloc-before-analysis.il.expected @@ -0,0 +1,334 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002b5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000343", condition()) + ) + ) + Block("1816:l00000343", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1840:l00000351", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000036a", condition()) + ) + ) + Block("1828:l0000036a", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000351", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000035d", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002b5", condition()) + ) + ) + Block("1852:l000002b5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1928:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1928:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1464:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1480bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1480:l00000570", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001df", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l00000603", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l000001f5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003ba", condition()) + ) + ) + Block("1668:l000001f5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003ba", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000023a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000039c", condition()) + ) + ) + Block("1704:l0000039c", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1724:l0000023a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003af", condition()) + ) + ) + Block("1724:l0000023a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003af", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1952bv64)) + LocalAssign(Register(R1, bv64) := 65bv64) + LocalAssign(Register(R30, bv64) := 1900bv64) + ), + jumps( + DirectCall("1584:printf", condition()) + ) + ) + Block("1900:l00000312", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1969bv64)) + LocalAssign(Register(R1, bv64) := 42bv64) + LocalAssign(Register(R30, bv64) := 1916bv64) + ), + jumps( + DirectCall("1584:printf", condition()) + ) + ) + Block("1916:l00000329", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1584:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000037e", condition()) + ) + ) + Block("1764:l0000037e", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000391", condition()) + ) + ) + Block("1784:l00000276", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000391", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/multi_malloc/clang_no_plt_no_pic/multi_malloc-before-analysis.il.expected b/src/test/correct/multi_malloc/clang_no_plt_no_pic/multi_malloc-before-analysis.il.expected new file mode 100644 index 000000000..34e6c6a08 --- /dev/null +++ b/src/test/correct/multi_malloc/clang_no_plt_no_pic/multi_malloc-before-analysis.il.expected @@ -0,0 +1,388 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000a3f", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l00000b6b", condition()) + ) + ) + Block("2008:l00000b6b", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("2032:l00000b79", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000b92", condition()) + ) + ) + Block("2020:l00000b92", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l00000b79", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000b85", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000a3f", condition()) + ) + ) + Block("2044:l00000a3f", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2212:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2212:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l00000d8b", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l00000969", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l00000e3d", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1860:l0000097f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000be2", condition()) + ) + ) + Block("1860:l0000097f", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000be2", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l000009c4", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000bc4", condition()) + ) + ) + Block("1896:l00000bc4", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1916:l000009c4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000bd7", condition()) + ) + ) + Block("1916:l000009c4", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000bd7", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + LocalAssign(Register(R8, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2100bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2100:l00000aa7", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2112bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2112:l00000abb", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R8, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R8, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2236bv64)) + LocalAssign(Register(R30, bv64) := 2160bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2160:l00000b0c", + statements( + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2253bv64)) + LocalAssign(Register(R30, bv64) := 2180bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2180:l00000b2c", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R30, bv64) := 2188bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2188:l00000b3b", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2196bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2196:l00000b49", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l00000a00", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000ba6", condition()) + ) + ) + Block("1956:l00000ba6", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1976:l00000a00", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l00000bb9", condition()) + ) + ) + Block("1976:l00000a00", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l00000bb9", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/multi_malloc/clang_pic/multi_malloc-before-analysis.il.expected b/src/test/correct/multi_malloc/clang_pic/multi_malloc-before-analysis.il.expected new file mode 100644 index 000000000..34e6c6a08 --- /dev/null +++ b/src/test/correct/multi_malloc/clang_pic/multi_malloc-before-analysis.il.expected @@ -0,0 +1,388 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000a3f", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l00000b6b", condition()) + ) + ) + Block("2008:l00000b6b", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("2032:l00000b79", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000b92", condition()) + ) + ) + Block("2020:l00000b92", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l00000b79", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000b85", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000a3f", condition()) + ) + ) + Block("2044:l00000a3f", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2212:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2212:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l00000d8b", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l00000969", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l00000e3d", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1860:l0000097f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000be2", condition()) + ) + ) + Block("1860:l0000097f", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000be2", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l000009c4", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000bc4", condition()) + ) + ) + Block("1896:l00000bc4", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1916:l000009c4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000bd7", condition()) + ) + ) + Block("1916:l000009c4", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000bd7", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + LocalAssign(Register(R8, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2100bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2100:l00000aa7", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2112bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2112:l00000abb", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R8, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R8, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2236bv64)) + LocalAssign(Register(R30, bv64) := 2160bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2160:l00000b0c", + statements( + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2253bv64)) + LocalAssign(Register(R30, bv64) := 2180bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2180:l00000b2c", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R30, bv64) := 2188bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2188:l00000b3b", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2196bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2196:l00000b49", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l00000a00", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000ba6", condition()) + ) + ) + Block("1956:l00000ba6", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1976:l00000a00", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l00000bb9", condition()) + ) + ) + Block("1976:l00000a00", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l00000bb9", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/multi_malloc/gcc/multi_malloc-before-analysis.il.expected b/src/test/correct/multi_malloc/gcc/multi_malloc-before-analysis.il.expected new file mode 100644 index 000000000..decb458cf --- /dev/null +++ b/src/test/correct/multi_malloc/gcc/multi_malloc-before-analysis.il.expected @@ -0,0 +1,386 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000305", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l0000041f", condition()) + ) + ) + Block("2008:l0000041f", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("2032:l0000042d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000446", condition()) + ) + ) + Block("2020:l00000446", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l0000042d", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000439", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000305", condition()) + ) + ) + Block("2044:l00000305", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2200:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2200:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l0000063f", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l0000022f", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l000006ee", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1860:l00000245", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000496", condition()) + ) + ) + Block("1860:l00000245", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000496", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000478", condition()) + ) + ) + Block("1896:l00000478", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1916:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l0000048b", condition()) + ) + ) + Block("1916:l0000028a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l0000048b", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2084bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2084:l00000357", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2096bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2096:l0000036b", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R1, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R1, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2232bv64)) + LocalAssign(Register(R30, bv64) := 2148bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2148:l000003c2", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2256bv64)) + LocalAssign(Register(R30, bv64) := 2172bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2172:l000003e8", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R30, bv64) := 2180bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2180:l000003f7", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R30, bv64) := 2188bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2188:l00000405", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l000002c6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l0000045a", condition()) + ) + ) + Block("1956:l0000045a", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1976:l000002c6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l0000046d", condition()) + ) + ) + Block("1976:l000002c6", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l0000046d", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/multi_malloc/gcc_O2/multi_malloc-before-analysis.il.expected b/src/test/correct/multi_malloc/gcc_O2/multi_malloc-before-analysis.il.expected new file mode 100644 index 000000000..1fe472897 --- /dev/null +++ b/src/test/correct/multi_malloc/gcc_O2/multi_malloc-before-analysis.il.expected @@ -0,0 +1,336 @@ +Procedure("1552:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1980:l00000332", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1944:l0000035b", condition()) + ) + ) + Block("1944:l0000035b", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1968:l00000369", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000382", condition()) + ) + ) + Block("1956:l00000382", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1968bv64) + ), + jumps( + DirectCall("1552:__cxa_finalize", condition()) + ) + ) + Block("1968:l00000369", + statements( + LocalAssign(Register(R30, bv64) := 1972bv64) + ), + jumps( + DirectCall("1808:deregister_tm_clones", condition()) + ) + ) + Block("1972:l00000375", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1980:l00000332", condition()) + ) + ) + Block("1980:l00000332", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1568:__printf_chk", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2004:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2004:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1472:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1488bv64) + ), + jumps( + DirectCall("1780:call_weak_fn", condition()) + ) + ) + Block("1488:l0000052f", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1536:__libc_start_main", condition()) + ) + ) + Block("1776:l0000025c", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1600:abort", condition()) + ) + ) + Block("?:l000005a9", + statements( + ), + jumps( + DirectCall("1780:call_weak_fn", condition()) + ) + ) +)), +Procedure("1600:abort", in(), out(), blocks( +)), +Procedure("1780:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1780:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1796:l00000272", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1792:l000003d2", condition()) + ) + ) + Block("1796:l00000272", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1792:l000003d2", + statements( + ), + jumps( + GoTo("1584:l__gmon_start__", condition()) + ) + ) + Block("1584:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1808:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1852:l000002b7", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1832:l000003b4", condition()) + ) + ) + Block("1832:l000003b4", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1852:l000002b7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1844:l000003c7", condition()) + ) + ) + Block("1852:l000002b7", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1844:l000003c7", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2000:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2000:lframe_dummy", + statements( + ), + jumps( + DirectCall("1856:register_tm_clones", condition()) + ) + ) +)), +Procedure("1664:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1664:lmain", + statements( + LocalAssign(LocalVar(#1, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#1, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#1, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#1, bv64)) + LocalAssign(Register(R2, bv64) := 65bv64) + LocalAssign(Register(R1, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2032bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 1692bv64) + ), + jumps( + DirectCall("1568:__printf_chk", condition()) + ) + ) + Block("1692:l000001e1", + statements( + LocalAssign(Register(R2, bv64) := 42bv64) + LocalAssign(Register(R1, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2056bv64)) + LocalAssign(Register(R30, bv64) := 1712bv64) + ), + jumps( + DirectCall("1568:__printf_chk", condition()) + ) + ) + Block("1712:l000001fd", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1856:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1912:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1892:l00000396", condition()) + ) + ) + Block("1892:l00000396", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1912:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1904:l000003a9", condition()) + ) + ) + Block("1912:l000002f3", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1904:l000003a9", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/multi_malloc/gcc_no_plt_no_pic/multi_malloc-before-analysis.il.expected b/src/test/correct/multi_malloc/gcc_no_plt_no_pic/multi_malloc-before-analysis.il.expected new file mode 100644 index 000000000..5f65619ac --- /dev/null +++ b/src/test/correct/multi_malloc/gcc_no_plt_no_pic/multi_malloc-before-analysis.il.expected @@ -0,0 +1,386 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000a12", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l00000b2c", condition()) + ) + ) + Block("2008:l00000b2c", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("2032:l00000b3a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000b53", condition()) + ) + ) + Block("2020:l00000b53", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l00000b3a", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000b46", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000a12", condition()) + ) + ) + Block("2044:l00000a12", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2200:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2200:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l00000d4c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l0000093c", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l00000dfb", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1860:l00000952", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000ba3", condition()) + ) + ) + Block("1860:l00000952", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000ba3", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l00000997", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000b85", condition()) + ) + ) + Block("1896:l00000b85", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1916:l00000997", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000b98", condition()) + ) + ) + Block("1916:l00000997", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000b98", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2084bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2084:l00000a64", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2096bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2096:l00000a78", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R1, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R1, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2232bv64)) + LocalAssign(Register(R30, bv64) := 2148bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2148:l00000acf", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2256bv64)) + LocalAssign(Register(R30, bv64) := 2172bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2172:l00000af5", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R30, bv64) := 2180bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2180:l00000b04", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R30, bv64) := 2188bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2188:l00000b12", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l000009d3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000b67", condition()) + ) + ) + Block("1956:l00000b67", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1976:l000009d3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l00000b7a", condition()) + ) + ) + Block("1976:l000009d3", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l00000b7a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/multi_malloc/gcc_pic/multi_malloc-before-analysis.il.expected b/src/test/correct/multi_malloc/gcc_pic/multi_malloc-before-analysis.il.expected new file mode 100644 index 000000000..5f65619ac --- /dev/null +++ b/src/test/correct/multi_malloc/gcc_pic/multi_malloc-before-analysis.il.expected @@ -0,0 +1,386 @@ +Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1984:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("2044:l00000a12", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("2008:l00000b2c", condition()) + ) + ) + Block("2008:l00000b2c", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("2032:l00000b3a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("2020:l00000b53", condition()) + ) + ) + Block("2020:l00000b53", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 2032bv64) + ), + jumps( + DirectCall("1648:__cxa_finalize", condition()) + ) + ) + Block("2032:l00000b3a", + statements( + LocalAssign(Register(R30, bv64) := 2036bv64) + ), + jumps( + DirectCall("1872:deregister_tm_clones", condition()) + ) + ) + Block("2036:l00000b46", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("2044:l00000a12", condition()) + ) + ) + Block("2044:l00000a12", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1632:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2200:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2200:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1576:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1592bv64) + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) + Block("1592:l00000d4c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1632:__libc_start_main", condition()) + ) + ) + Block("1840:l0000093c", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1696:abort", condition()) + ) + ) + Block("?:l00000dfb", + statements( + ), + jumps( + DirectCall("1844:call_weak_fn", condition()) + ) + ) +)), +Procedure("1696:abort", in(), out(), blocks( +)), +Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1860:l00000952", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1856:l00000ba3", condition()) + ) + ) + Block("1860:l00000952", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1856:l00000ba3", + statements( + ), + jumps( + GoTo("1680:l__gmon_start__", condition()) + ) + ) + Block("1680:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1916:l00000997", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l00000b85", condition()) + ) + ) + Block("1896:l00000b85", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1916:l00000997", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1908:l00000b98", condition()) + ) + ) + Block("1916:l00000997", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1908:l00000b98", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2064:lframe_dummy", + statements( + ), + jumps( + DirectCall("1920:register_tm_clones", condition()) + ) + ) +)), +Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("2068:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + LocalAssign(Register(R30, bv64) := 2084bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2084:l00000a64", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 4bv64) + LocalAssign(Register(R30, bv64) := 2096bv64) + ), + jumps( + DirectCall("1664:malloc", condition()) + ) + ) + Block("2096:l00000a78", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R1, bv64) := 65bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R1, bv64) := 42bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2232bv64)) + LocalAssign(Register(R30, bv64) := 2148bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2148:l00000acf", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2256bv64)) + LocalAssign(Register(R30, bv64) := 2172bv64) + ), + jumps( + DirectCall("1728:printf", condition()) + ) + ) + Block("2172:l00000af5", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R30, bv64) := 2180bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2180:l00000b04", + statements( + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) + LocalAssign(Register(R30, bv64) := 2188bv64) + ), + jumps( + DirectCall("1712:#free", condition()) + ) + ) + Block("2188:l00000b12", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1920:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1976:l000009d3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1956:l00000b67", condition()) + ) + ) + Block("1956:l00000b67", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1976:l000009d3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1968:l00000b7a", condition()) + ) + ) + Block("1976:l000009d3", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1968:l00000b7a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/nestedif/clang/nestedif-before-analysis.il.expected b/src/test/correct/nestedif/clang/nestedif-before-analysis.il.expected new file mode 100644 index 000000000..98c938269 --- /dev/null +++ b/src/test/correct/nestedif/clang/nestedif-before-analysis.il.expected @@ -0,0 +1,487 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000309", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000457", condition()) + ) + ) + Block("1752:l00000457", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000465", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000047e", condition()) + ) + ) + Block("1764:l0000047e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000465", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000471", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000309", condition()) + ) + ) + Block("1788:l00000309", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1948:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1948:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000673", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000233", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000073c", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000249", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000004ce", condition()) + ) + ) + Block("1604:l00000249", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000004ce", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000004b0", condition()) + ) + ) + Block("1640:l000004b0", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000004c3", condition()) + ) + ) + Block("1660:l0000028e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000004c3", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000379", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l0000037c", condition()) + ) + ) + Block("?:l0000037c", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l0000037f", condition()) + ) + ) + Block("?:l00000379", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l0000037f", condition()) + ) + ) + Block("?:l0000037f", + statements( + ), + jumps( + GoTo("1864:l00000387", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1848:l00000442", condition()) + ) + ) + Block("1864:l00000387", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l000003b2", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l000003b5", condition()) + ) + ) + Block("?:l000003b5", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l000003b8", condition()) + ) + ) + Block("?:l000003b2", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l000003b8", condition()) + ) + ) + Block("?:l000003b8", + statements( + ), + jumps( + GoTo("1896:l000003c0", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1880:l0000042d", condition()) + ) + ) + Block("1896:l000003c0", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967293bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934590bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967294bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l000003eb", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l000003ee", condition()) + ) + ) + Block("?:l000003ee", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l000003f1", condition()) + ) + ) + Block("?:l000003eb", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l000003f1", condition()) + ) + ) + Block("?:l000003f1", + statements( + ), + jumps( + GoTo("1928:l000003f9", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1912:l00000418", condition()) + ) + ) + Block("1912:l00000418", + statements( + ), + jumps( + GoTo("1916:l00000419", condition()) + ) + ) + Block("1916:l00000419", + statements( + LocalAssign(Register(R8, bv64) := 7bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1928:l000003f9", condition()) + ) + ) + Block("1928:l000003f9", + statements( + ), + jumps( + GoTo("1932:l000003ff", condition()) + ) + ) + Block("1880:l0000042d", + statements( + ), + jumps( + GoTo("1884:l0000042e", condition()) + ) + ) + Block("1884:l0000042e", + statements( + LocalAssign(Register(R8, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1932:l000003ff", condition()) + ) + ) + Block("1932:l000003ff", + statements( + ), + jumps( + GoTo("1936:l00000403", condition()) + ) + ) + Block("1848:l00000442", + statements( + ), + jumps( + GoTo("1852:l00000443", condition()) + ) + ) + Block("1852:l00000443", + statements( + LocalAssign(Register(R8, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1936:l00000403", condition()) + ) + ) + Block("1936:l00000403", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000002ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000492", condition()) + ) + ) + Block("1700:l00000492", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000002ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000004a5", condition()) + ) + ) + Block("1720:l000002ca", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000004a5", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/nestedif/clang_O2/nestedif-before-analysis.il.expected b/src/test/correct/nestedif/clang_O2/nestedif-before-analysis.il.expected new file mode 100644 index 000000000..5a5a5bf1d --- /dev/null +++ b/src/test/correct/nestedif/clang_O2/nestedif-before-analysis.il.expected @@ -0,0 +1,302 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000289", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002bc", condition()) + ) + ) + Block("1752:l000002bc", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000002e3", condition()) + ) + ) + Block("1764:l000002e3", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002ca", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002d6", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000289", condition()) + ) + ) + Block("1788:l00000289", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1820:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1820:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004b8", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001b3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000055e", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001c9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000333", condition()) + ) + ) + Block("1604:l000001c9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000333", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000020e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000315", condition()) + ) + ) + Block("1640:l00000315", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000020e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000328", condition()) + ) + ) + Block("1660:l0000020e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000328", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000002f7", condition()) + ) + ) + Block("1700:l000002f7", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000030a", condition()) + ) + ) + Block("1720:l0000024a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000030a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/nestedif/clang_no_plt_no_pic/nestedif-before-analysis.il.expected b/src/test/correct/nestedif/clang_no_plt_no_pic/nestedif-before-analysis.il.expected new file mode 100644 index 000000000..1415905d0 --- /dev/null +++ b/src/test/correct/nestedif/clang_no_plt_no_pic/nestedif-before-analysis.il.expected @@ -0,0 +1,487 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000a3a", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000b88", condition()) + ) + ) + Block("1752:l00000b88", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000b96", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000baf", condition()) + ) + ) + Block("1764:l00000baf", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000b96", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000ba2", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000a3a", condition()) + ) + ) + Block("1788:l00000a3a", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1948:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1948:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000da4", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000964", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000e48", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000097a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000bff", condition()) + ) + ) + Block("1604:l0000097a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000bff", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000009bf", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000be1", condition()) + ) + ) + Block("1640:l00000be1", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l000009bf", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000bf4", condition()) + ) + ) + Block("1660:l000009bf", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000bf4", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000aaa", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000aad", condition()) + ) + ) + Block("?:l00000aad", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000ab0", condition()) + ) + ) + Block("?:l00000aaa", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000ab0", condition()) + ) + ) + Block("?:l00000ab0", + statements( + ), + jumps( + GoTo("1864:l00000ab8", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1848:l00000b73", condition()) + ) + ) + Block("1864:l00000ab8", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000ae3", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000ae6", condition()) + ) + ) + Block("?:l00000ae6", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000ae9", condition()) + ) + ) + Block("?:l00000ae3", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000ae9", condition()) + ) + ) + Block("?:l00000ae9", + statements( + ), + jumps( + GoTo("1896:l00000af1", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1880:l00000b5e", condition()) + ) + ) + Block("1896:l00000af1", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967293bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934590bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967294bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000b1c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000b1f", condition()) + ) + ) + Block("?:l00000b1f", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000b22", condition()) + ) + ) + Block("?:l00000b1c", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000b22", condition()) + ) + ) + Block("?:l00000b22", + statements( + ), + jumps( + GoTo("1928:l00000b2a", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1912:l00000b49", condition()) + ) + ) + Block("1912:l00000b49", + statements( + ), + jumps( + GoTo("1916:l00000b4a", condition()) + ) + ) + Block("1916:l00000b4a", + statements( + LocalAssign(Register(R8, bv64) := 7bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1928:l00000b2a", condition()) + ) + ) + Block("1928:l00000b2a", + statements( + ), + jumps( + GoTo("1932:l00000b30", condition()) + ) + ) + Block("1880:l00000b5e", + statements( + ), + jumps( + GoTo("1884:l00000b5f", condition()) + ) + ) + Block("1884:l00000b5f", + statements( + LocalAssign(Register(R8, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1932:l00000b30", condition()) + ) + ) + Block("1932:l00000b30", + statements( + ), + jumps( + GoTo("1936:l00000b34", condition()) + ) + ) + Block("1848:l00000b73", + statements( + ), + jumps( + GoTo("1852:l00000b74", condition()) + ) + ) + Block("1852:l00000b74", + statements( + LocalAssign(Register(R8, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1936:l00000b34", condition()) + ) + ) + Block("1936:l00000b34", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000009fb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000bc3", condition()) + ) + ) + Block("1700:l00000bc3", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000009fb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000bd6", condition()) + ) + ) + Block("1720:l000009fb", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000bd6", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/nestedif/clang_pic/nestedif-before-analysis.il.expected b/src/test/correct/nestedif/clang_pic/nestedif-before-analysis.il.expected new file mode 100644 index 000000000..1415905d0 --- /dev/null +++ b/src/test/correct/nestedif/clang_pic/nestedif-before-analysis.il.expected @@ -0,0 +1,487 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000a3a", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000b88", condition()) + ) + ) + Block("1752:l00000b88", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000b96", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000baf", condition()) + ) + ) + Block("1764:l00000baf", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000b96", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000ba2", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000a3a", condition()) + ) + ) + Block("1788:l00000a3a", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1948:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1948:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000da4", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000964", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000e48", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000097a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000bff", condition()) + ) + ) + Block("1604:l0000097a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000bff", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000009bf", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000be1", condition()) + ) + ) + Block("1640:l00000be1", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l000009bf", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000bf4", condition()) + ) + ) + Block("1660:l000009bf", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000bf4", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000aaa", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000aad", condition()) + ) + ) + Block("?:l00000aad", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000ab0", condition()) + ) + ) + Block("?:l00000aaa", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000ab0", condition()) + ) + ) + Block("?:l00000ab0", + statements( + ), + jumps( + GoTo("1864:l00000ab8", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1848:l00000b73", condition()) + ) + ) + Block("1864:l00000ab8", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000ae3", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000ae6", condition()) + ) + ) + Block("?:l00000ae6", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000ae9", condition()) + ) + ) + Block("?:l00000ae3", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000ae9", condition()) + ) + ) + Block("?:l00000ae9", + statements( + ), + jumps( + GoTo("1896:l00000af1", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1880:l00000b5e", condition()) + ) + ) + Block("1896:l00000af1", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967293bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934590bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967294bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000b1c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000b1f", condition()) + ) + ) + Block("?:l00000b1f", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000b22", condition()) + ) + ) + Block("?:l00000b1c", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000b22", condition()) + ) + ) + Block("?:l00000b22", + statements( + ), + jumps( + GoTo("1928:l00000b2a", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1912:l00000b49", condition()) + ) + ) + Block("1912:l00000b49", + statements( + ), + jumps( + GoTo("1916:l00000b4a", condition()) + ) + ) + Block("1916:l00000b4a", + statements( + LocalAssign(Register(R8, bv64) := 7bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1928:l00000b2a", condition()) + ) + ) + Block("1928:l00000b2a", + statements( + ), + jumps( + GoTo("1932:l00000b30", condition()) + ) + ) + Block("1880:l00000b5e", + statements( + ), + jumps( + GoTo("1884:l00000b5f", condition()) + ) + ) + Block("1884:l00000b5f", + statements( + LocalAssign(Register(R8, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1932:l00000b30", condition()) + ) + ) + Block("1932:l00000b30", + statements( + ), + jumps( + GoTo("1936:l00000b34", condition()) + ) + ) + Block("1848:l00000b73", + statements( + ), + jumps( + GoTo("1852:l00000b74", condition()) + ) + ) + Block("1852:l00000b74", + statements( + LocalAssign(Register(R8, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1936:l00000b34", condition()) + ) + ) + Block("1936:l00000b34", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000009fb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000bc3", condition()) + ) + ) + Block("1700:l00000bc3", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000009fb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000bd6", condition()) + ) + ) + Block("1720:l000009fb", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000bd6", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/nestedif/gcc/nestedif-before-analysis.il.expected b/src/test/correct/nestedif/gcc/nestedif-before-analysis.il.expected new file mode 100644 index 000000000..b3988847c --- /dev/null +++ b/src/test/correct/nestedif/gcc/nestedif-before-analysis.il.expected @@ -0,0 +1,376 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002e1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000003d5", condition()) + ) + ) + Block("1752:l000003d5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000003e3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003fc", condition()) + ) + ) + Block("1764:l000003fc", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000003e3", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000003ef", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002e1", condition()) + ) + ) + Block("1788:l000002e1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1908:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1908:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000005e7", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000020b", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000006a7", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000221", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000044c", condition()) + ) + ) + Block("1604:l00000221", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000044c", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000042e", condition()) + ) + ) + Block("1640:l0000042e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000441", condition()) + ) + ) + Block("1660:l00000266", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000441", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1852:l00000345", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1840:l000003c4", condition()) + ) + ) + Block("1852:l00000345", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1876:l0000036b", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1864:l000003b3", condition()) + ) + ) + Block("1876:l0000036b", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1896:l00000391", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1888:l000003a6", condition()) + ) + ) + Block("1888:l000003a6", + statements( + LocalAssign(Register(R0, bv64) := 7bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1896:l00000391", condition()) + ) + ) + Block("1864:l000003b3", + statements( + LocalAssign(Register(R0, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1896:l00000391", condition()) + ) + ) + Block("1840:l000003c4", + statements( + LocalAssign(Register(R0, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1896:l00000391", condition()) + ) + ) + Block("1896:l00000391", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000002a2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000410", condition()) + ) + ) + Block("1700:l00000410", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000002a2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000423", condition()) + ) + ) + Block("1720:l000002a2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000423", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/nestedif/gcc_O2/nestedif-before-analysis.il.expected b/src/test/correct/nestedif/gcc_O2/nestedif-before-analysis.il.expected new file mode 100644 index 000000000..82dc9ebf6 --- /dev/null +++ b/src/test/correct/nestedif/gcc_O2/nestedif-before-analysis.il.expected @@ -0,0 +1,302 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002e7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000310", condition()) + ) + ) + Block("1816:l00000310", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000031e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000337", condition()) + ) + ) + Block("1828:l00000337", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000031e", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000032a", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002e7", condition()) + ) + ) + Block("1852:l000002e7", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l0000051a", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000211", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005ce", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000227", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000387", condition()) + ) + ) + Block("1668:l00000227", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000387", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000026c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000369", condition()) + ) + ) + Block("1704:l00000369", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l0000026c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l0000037c", condition()) + ) + ) + Block("1724:l0000026c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l0000037c", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002a8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000034b", condition()) + ) + ) + Block("1764:l0000034b", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002a8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000035e", condition()) + ) + ) + Block("1784:l000002a8", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000035e", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/nestedif/gcc_no_plt_no_pic/nestedif-before-analysis.il.expected b/src/test/correct/nestedif/gcc_no_plt_no_pic/nestedif-before-analysis.il.expected new file mode 100644 index 000000000..9142faae4 --- /dev/null +++ b/src/test/correct/nestedif/gcc_no_plt_no_pic/nestedif-before-analysis.il.expected @@ -0,0 +1,376 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000097d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000a71", condition()) + ) + ) + Block("1752:l00000a71", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000a7f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000a98", condition()) + ) + ) + Block("1764:l00000a98", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000a7f", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000a8b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000097d", condition()) + ) + ) + Block("1788:l0000097d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1908:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1908:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000c83", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000008a7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000d1d", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000008bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000ae8", condition()) + ) + ) + Block("1604:l000008bd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000ae8", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000902", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000aca", condition()) + ) + ) + Block("1640:l00000aca", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000902", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000add", condition()) + ) + ) + Block("1660:l00000902", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000add", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1852:l000009e1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1840:l00000a60", condition()) + ) + ) + Block("1852:l000009e1", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1876:l00000a07", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1864:l00000a4f", condition()) + ) + ) + Block("1876:l00000a07", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1896:l00000a2d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1888:l00000a42", condition()) + ) + ) + Block("1888:l00000a42", + statements( + LocalAssign(Register(R0, bv64) := 7bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1896:l00000a2d", condition()) + ) + ) + Block("1864:l00000a4f", + statements( + LocalAssign(Register(R0, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1896:l00000a2d", condition()) + ) + ) + Block("1840:l00000a60", + statements( + LocalAssign(Register(R0, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1896:l00000a2d", condition()) + ) + ) + Block("1896:l00000a2d", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000093e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000aac", condition()) + ) + ) + Block("1700:l00000aac", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000093e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000abf", condition()) + ) + ) + Block("1720:l0000093e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000abf", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/nestedif/gcc_pic/nestedif-before-analysis.il.expected b/src/test/correct/nestedif/gcc_pic/nestedif-before-analysis.il.expected new file mode 100644 index 000000000..9142faae4 --- /dev/null +++ b/src/test/correct/nestedif/gcc_pic/nestedif-before-analysis.il.expected @@ -0,0 +1,376 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000097d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000a71", condition()) + ) + ) + Block("1752:l00000a71", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000a7f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000a98", condition()) + ) + ) + Block("1764:l00000a98", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000a7f", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000a8b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000097d", condition()) + ) + ) + Block("1788:l0000097d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1908:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1908:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000c83", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000008a7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000d1d", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000008bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000ae8", condition()) + ) + ) + Block("1604:l000008bd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000ae8", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000902", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000aca", condition()) + ) + ) + Block("1640:l00000aca", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000902", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000add", condition()) + ) + ) + Block("1660:l00000902", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000add", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1852:l000009e1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1840:l00000a60", condition()) + ) + ) + Block("1852:l000009e1", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1876:l00000a07", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1864:l00000a4f", condition()) + ) + ) + Block("1876:l00000a07", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1896:l00000a2d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1888:l00000a42", condition()) + ) + ) + Block("1888:l00000a42", + statements( + LocalAssign(Register(R0, bv64) := 7bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1896:l00000a2d", condition()) + ) + ) + Block("1864:l00000a4f", + statements( + LocalAssign(Register(R0, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1896:l00000a2d", condition()) + ) + ) + Block("1840:l00000a60", + statements( + LocalAssign(Register(R0, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1896:l00000a2d", condition()) + ) + ) + Block("1896:l00000a2d", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000093e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000aac", condition()) + ) + ) + Block("1700:l00000aac", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000093e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000abf", condition()) + ) + ) + Block("1720:l0000093e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000abf", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/no_interference_update_x/clang/no_interference_update_x-before-analysis.il.expected b/src/test/correct/no_interference_update_x/clang/no_interference_update_x-before-analysis.il.expected new file mode 100644 index 000000000..8a23eadb8 --- /dev/null +++ b/src/test/correct/no_interference_update_x/clang/no_interference_update_x-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002da", condition()) + ) + ) + Block("1752:l000002da", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000301", condition()) + ) + ) + Block("1764:l00000301", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002e8", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002f4", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000295", condition()) + ) + ) + Block("1788:l00000295", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1832:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004d9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001bf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000582", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000351", condition()) + ) + ) + Block("1604:l000001d5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000351", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000333", condition()) + ) + ) + Block("1640:l00000333", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000346", condition()) + ) + ) + Block("1660:l0000021a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000346", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000315", condition()) + ) + ) + Block("1700:l00000315", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000328", condition()) + ) + ) + Block("1720:l00000256", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000328", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/no_interference_update_x/clang_O2/no_interference_update_x-before-analysis.il.expected b/src/test/correct/no_interference_update_x/clang_O2/no_interference_update_x-before-analysis.il.expected new file mode 100644 index 000000000..e47151e8a --- /dev/null +++ b/src/test/correct/no_interference_update_x/clang_O2/no_interference_update_x-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002da", condition()) + ) + ) + Block("1752:l000002da", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000301", condition()) + ) + ) + Block("1764:l00000301", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002e8", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002f4", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000295", condition()) + ) + ) + Block("1788:l00000295", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1832:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004d9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001bf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000582", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000351", condition()) + ) + ) + Block("1604:l000001d5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000351", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000333", condition()) + ) + ) + Block("1640:l00000333", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000346", condition()) + ) + ) + Block("1660:l0000021a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000346", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 1bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000315", condition()) + ) + ) + Block("1700:l00000315", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000328", condition()) + ) + ) + Block("1720:l00000256", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000328", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/no_interference_update_x/clang_no_plt_no_pic/no_interference_update_x-before-analysis.il.expected b/src/test/correct/no_interference_update_x/clang_no_plt_no_pic/no_interference_update_x-before-analysis.il.expected new file mode 100644 index 000000000..37424e6b7 --- /dev/null +++ b/src/test/correct/no_interference_update_x/clang_no_plt_no_pic/no_interference_update_x-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000080c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000851", condition()) + ) + ) + Block("1752:l00000851", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000085f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000878", condition()) + ) + ) + Block("1764:l00000878", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000085f", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000086b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000080c", condition()) + ) + ) + Block("1788:l0000080c", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1832:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000a50", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000736", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000ad7", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000074c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000008c8", condition()) + ) + ) + Block("1604:l0000074c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000008c8", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000008aa", condition()) + ) + ) + Block("1640:l000008aa", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000008bd", condition()) + ) + ) + Block("1660:l00000791", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000008bd", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000088c", condition()) + ) + ) + Block("1700:l0000088c", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000089f", condition()) + ) + ) + Block("1720:l000007cd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000089f", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/no_interference_update_x/clang_pic/no_interference_update_x-before-analysis.il.expected b/src/test/correct/no_interference_update_x/clang_pic/no_interference_update_x-before-analysis.il.expected new file mode 100644 index 000000000..bba5c8aee --- /dev/null +++ b/src/test/correct/no_interference_update_x/clang_pic/no_interference_update_x-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000002e5", condition()) + ) + ) + Block("1816:l000002e5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) + ), + jumps( + GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000030c", condition()) + ) + ) + Block("1828:l0000030c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l000002f3", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000002ff", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l00000299", condition()) + ) + ) + Block("1852:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1900:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l00000493", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l0000053d", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000035c", condition()) + ) + ) + Block("1668:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000035c", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000033e", condition()) + ) + ) + Block("1704:l0000033e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000351", condition()) + ) + ) + Block("1724:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000351", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4040bv64)])) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000320", condition()) + ) + ) + Block("1764:l00000320", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000333", condition()) + ) + ) + Block("1784:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000333", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/no_interference_update_x/gcc/no_interference_update_x-before-analysis.il.expected b/src/test/correct/no_interference_update_x/gcc/no_interference_update_x-before-analysis.il.expected new file mode 100644 index 000000000..4e55ece6b --- /dev/null +++ b/src/test/correct/no_interference_update_x/gcc/no_interference_update_x-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002e4", condition()) + ) + ) + Block("1752:l000002e4", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000002f2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000030b", condition()) + ) + ) + Block("1764:l0000030b", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002f2", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002fe", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000299", condition()) + ) + ) + Block("1788:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004e4", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000058e", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000035b", condition()) + ) + ) + Block("1604:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000035b", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000033d", condition()) + ) + ) + Block("1640:l0000033d", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000350", condition()) + ) + ) + Block("1660:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000350", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000031f", condition()) + ) + ) + Block("1700:l0000031f", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000332", condition()) + ) + ) + Block("1720:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000332", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/no_interference_update_x/gcc_O2/no_interference_update_x-before-analysis.il.expected b/src/test/correct/no_interference_update_x/gcc_O2/no_interference_update_x-before-analysis.il.expected new file mode 100644 index 000000000..bebedbe2b --- /dev/null +++ b/src/test/correct/no_interference_update_x/gcc_O2/no_interference_update_x-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f3", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000031c", condition()) + ) + ) + Block("1816:l0000031c", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000032a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000343", condition()) + ) + ) + Block("1828:l00000343", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000032a", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000336", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f3", condition()) + ) + ) + Block("1852:l000002f3", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l00000526", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l0000021d", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005da", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000233", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000393", condition()) + ) + ) + Block("1668:l00000233", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000393", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000375", condition()) + ) + ) + Block("1704:l00000375", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000388", condition()) + ) + ) + Block("1724:l00000278", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000388", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R2, bv64) := 1bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R2, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000357", condition()) + ) + ) + Block("1764:l00000357", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000036a", condition()) + ) + ) + Block("1784:l000002b4", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000036a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/no_interference_update_x/gcc_no_plt_no_pic/no_interference_update_x-before-analysis.il.expected b/src/test/correct/no_interference_update_x/gcc_no_plt_no_pic/no_interference_update_x-before-analysis.il.expected new file mode 100644 index 000000000..7f7a9b76c --- /dev/null +++ b/src/test/correct/no_interference_update_x/gcc_no_plt_no_pic/no_interference_update_x-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000081c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000867", condition()) + ) + ) + Block("1752:l00000867", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000088e", condition()) + ) + ) + Block("1764:l0000088e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000875", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000881", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000081c", condition()) + ) + ) + Block("1788:l0000081c", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000a67", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000746", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000aef", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l0000075c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000008de", condition()) + ) + ) + Block("1604:l0000075c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000008de", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000008c0", condition()) + ) + ) + Block("1640:l000008c0", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000008d3", condition()) + ) + ) + Block("1660:l000007a1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000008d3", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000008a2", condition()) + ) + ) + Block("1700:l000008a2", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000008b5", condition()) + ) + ) + Block("1720:l000007dd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000008b5", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/no_interference_update_x/gcc_pic/no_interference_update_x-before-analysis.il.expected b/src/test/correct/no_interference_update_x/gcc_pic/no_interference_update_x-before-analysis.il.expected new file mode 100644 index 000000000..da93bfeeb --- /dev/null +++ b/src/test/correct/no_interference_update_x/gcc_pic/no_interference_update_x-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000002e5", condition()) + ) + ) + Block("1816:l000002e5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + ), + jumps( + GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000030c", condition()) + ) + ) + Block("1828:l0000030c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l000002f3", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000002ff", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l00000299", condition()) + ) + ) + Block("1852:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1900:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l00000493", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l0000053d", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000035c", condition()) + ) + ) + Block("1668:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000035c", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000033e", condition()) + ) + ) + Block("1704:l0000033e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000351", condition()) + ) + ) + Block("1724:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000351", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000320", condition()) + ) + ) + Block("1764:l00000320", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000333", condition()) + ) + ) + Block("1784:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000333", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/no_interference_update_y/clang/no_interference_update_y-before-analysis.il.expected b/src/test/correct/no_interference_update_y/clang/no_interference_update_y-before-analysis.il.expected new file mode 100644 index 000000000..8a23eadb8 --- /dev/null +++ b/src/test/correct/no_interference_update_y/clang/no_interference_update_y-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002da", condition()) + ) + ) + Block("1752:l000002da", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000301", condition()) + ) + ) + Block("1764:l00000301", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002e8", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002f4", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000295", condition()) + ) + ) + Block("1788:l00000295", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1832:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004d9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001bf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000582", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000351", condition()) + ) + ) + Block("1604:l000001d5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000351", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000333", condition()) + ) + ) + Block("1640:l00000333", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000346", condition()) + ) + ) + Block("1660:l0000021a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000346", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000315", condition()) + ) + ) + Block("1700:l00000315", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000328", condition()) + ) + ) + Block("1720:l00000256", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000328", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/no_interference_update_y/clang_O2/no_interference_update_y-before-analysis.il.expected b/src/test/correct/no_interference_update_y/clang_O2/no_interference_update_y-before-analysis.il.expected new file mode 100644 index 000000000..e47151e8a --- /dev/null +++ b/src/test/correct/no_interference_update_y/clang_O2/no_interference_update_y-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002da", condition()) + ) + ) + Block("1752:l000002da", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000301", condition()) + ) + ) + Block("1764:l00000301", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002e8", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002f4", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000295", condition()) + ) + ) + Block("1788:l00000295", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1832:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004d9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001bf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000582", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000351", condition()) + ) + ) + Block("1604:l000001d5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000351", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000333", condition()) + ) + ) + Block("1640:l00000333", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000346", condition()) + ) + ) + Block("1660:l0000021a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000346", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 1bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000315", condition()) + ) + ) + Block("1700:l00000315", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000328", condition()) + ) + ) + Block("1720:l00000256", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000328", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/no_interference_update_y/clang_no_plt_no_pic/no_interference_update_y-before-analysis.il.expected b/src/test/correct/no_interference_update_y/clang_no_plt_no_pic/no_interference_update_y-before-analysis.il.expected new file mode 100644 index 000000000..37424e6b7 --- /dev/null +++ b/src/test/correct/no_interference_update_y/clang_no_plt_no_pic/no_interference_update_y-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000080c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000851", condition()) + ) + ) + Block("1752:l00000851", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000085f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000878", condition()) + ) + ) + Block("1764:l00000878", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000085f", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000086b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000080c", condition()) + ) + ) + Block("1788:l0000080c", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1832:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000a50", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000736", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000ad7", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000074c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000008c8", condition()) + ) + ) + Block("1604:l0000074c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000008c8", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000008aa", condition()) + ) + ) + Block("1640:l000008aa", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000008bd", condition()) + ) + ) + Block("1660:l00000791", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000008bd", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000088c", condition()) + ) + ) + Block("1700:l0000088c", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000089f", condition()) + ) + ) + Block("1720:l000007cd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000089f", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/no_interference_update_y/clang_pic/no_interference_update_y-before-analysis.il.expected b/src/test/correct/no_interference_update_y/clang_pic/no_interference_update_y-before-analysis.il.expected new file mode 100644 index 000000000..f4a77c1a6 --- /dev/null +++ b/src/test/correct/no_interference_update_y/clang_pic/no_interference_update_y-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000002e5", condition()) + ) + ) + Block("1816:l000002e5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) + ), + jumps( + GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000030c", condition()) + ) + ) + Block("1828:l0000030c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l000002f3", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000002ff", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l00000299", condition()) + ) + ) + Block("1852:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1900:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l00000493", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l0000053d", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000035c", condition()) + ) + ) + Block("1668:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000035c", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000033e", condition()) + ) + ) + Block("1704:l0000033e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000351", condition()) + ) + ) + Block("1724:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000351", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4048bv64)])) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000320", condition()) + ) + ) + Block("1764:l00000320", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000333", condition()) + ) + ) + Block("1784:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000333", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/no_interference_update_y/gcc/no_interference_update_y-before-analysis.il.expected b/src/test/correct/no_interference_update_y/gcc/no_interference_update_y-before-analysis.il.expected new file mode 100644 index 000000000..28b23d5f7 --- /dev/null +++ b/src/test/correct/no_interference_update_y/gcc/no_interference_update_y-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002e4", condition()) + ) + ) + Block("1752:l000002e4", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000002f2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000030b", condition()) + ) + ) + Block("1764:l0000030b", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002f2", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002fe", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000299", condition()) + ) + ) + Block("1788:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004e4", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000058e", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000035b", condition()) + ) + ) + Block("1604:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000035b", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000033d", condition()) + ) + ) + Block("1640:l0000033d", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000350", condition()) + ) + ) + Block("1660:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000350", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000031f", condition()) + ) + ) + Block("1700:l0000031f", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000332", condition()) + ) + ) + Block("1720:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000332", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/no_interference_update_y/gcc_O2/no_interference_update_y-before-analysis.il.expected b/src/test/correct/no_interference_update_y/gcc_O2/no_interference_update_y-before-analysis.il.expected new file mode 100644 index 000000000..bebedbe2b --- /dev/null +++ b/src/test/correct/no_interference_update_y/gcc_O2/no_interference_update_y-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f3", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000031c", condition()) + ) + ) + Block("1816:l0000031c", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000032a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000343", condition()) + ) + ) + Block("1828:l00000343", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000032a", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000336", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f3", condition()) + ) + ) + Block("1852:l000002f3", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l00000526", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l0000021d", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005da", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000233", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000393", condition()) + ) + ) + Block("1668:l00000233", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000393", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000375", condition()) + ) + ) + Block("1704:l00000375", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000388", condition()) + ) + ) + Block("1724:l00000278", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000388", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R2, bv64) := 1bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R2, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000357", condition()) + ) + ) + Block("1764:l00000357", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000036a", condition()) + ) + ) + Block("1784:l000002b4", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000036a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/no_interference_update_y/gcc_no_plt_no_pic/no_interference_update_y-before-analysis.il.expected b/src/test/correct/no_interference_update_y/gcc_no_plt_no_pic/no_interference_update_y-before-analysis.il.expected new file mode 100644 index 000000000..d319879d6 --- /dev/null +++ b/src/test/correct/no_interference_update_y/gcc_no_plt_no_pic/no_interference_update_y-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000081c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000867", condition()) + ) + ) + Block("1752:l00000867", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000088e", condition()) + ) + ) + Block("1764:l0000088e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000875", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000881", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000081c", condition()) + ) + ) + Block("1788:l0000081c", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000a67", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000746", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000aef", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l0000075c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000008de", condition()) + ) + ) + Block("1604:l0000075c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000008de", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000008c0", condition()) + ) + ) + Block("1640:l000008c0", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000008d3", condition()) + ) + ) + Block("1660:l000007a1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000008d3", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000008a2", condition()) + ) + ) + Block("1700:l000008a2", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000008b5", condition()) + ) + ) + Block("1720:l000007dd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000008b5", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/no_interference_update_y/gcc_pic/no_interference_update_y-before-analysis.il.expected b/src/test/correct/no_interference_update_y/gcc_pic/no_interference_update_y-before-analysis.il.expected new file mode 100644 index 000000000..9701eb1d7 --- /dev/null +++ b/src/test/correct/no_interference_update_y/gcc_pic/no_interference_update_y-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000002e5", condition()) + ) + ) + Block("1816:l000002e5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + ), + jumps( + GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000030c", condition()) + ) + ) + Block("1828:l0000030c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l000002f3", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000002ff", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l00000299", condition()) + ) + ) + Block("1852:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1900:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l00000493", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l0000053d", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000035c", condition()) + ) + ) + Block("1668:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000035c", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000033e", condition()) + ) + ) + Block("1704:l0000033e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000351", condition()) + ) + ) + Block("1724:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000351", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000320", condition()) + ) + ) + Block("1764:l00000320", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000333", condition()) + ) + ) + Block("1784:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000333", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/secret_write/clang/secret_write-before-analysis.il.expected b/src/test/correct/secret_write/clang/secret_write-before-analysis.il.expected new file mode 100644 index 000000000..0a615f2f8 --- /dev/null +++ b/src/test/correct/secret_write/clang/secret_write-before-analysis.il.expected @@ -0,0 +1,315 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000346", condition()) + ) + ) + Block("1752:l00000346", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000354", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000036d", condition()) + ) + ) + Block("1764:l0000036d", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000354", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000360", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002bd", condition()) + ) + ) + Block("1788:l000002bd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l0000054f", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001e7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000602", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003bd", condition()) + ) + ) + Block("1604:l000001fd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003bd", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000039f", condition()) + ) + ) + Block("1640:l0000039f", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003b2", condition()) + ) + ) + Block("1660:l00000242", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003b2", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 60bv64)] := Extract(Register(R10, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 60bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000381", condition()) + ) + ) + Block("1700:l00000381", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000394", condition()) + ) + ) + Block("1720:l0000027e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000394", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/secret_write/clang_O2/secret_write-before-analysis.il.expected b/src/test/correct/secret_write/clang_O2/secret_write-before-analysis.il.expected new file mode 100644 index 000000000..59205a2db --- /dev/null +++ b/src/test/correct/secret_write/clang_O2/secret_write-before-analysis.il.expected @@ -0,0 +1,307 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002ee", condition()) + ) + ) + Block("1752:l000002ee", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002fc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000315", condition()) + ) + ) + Block("1764:l00000315", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002fc", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000308", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000029d", condition()) + ) + ) + Block("1788:l0000029d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1840:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004ef", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000059a", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000365", condition()) + ) + ) + Block("1604:l000001dd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000365", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000347", condition()) + ) + ) + Block("1640:l00000347", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000035a", condition()) + ) + ) + Block("1660:l00000222", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000035a", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R10, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 60bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R10, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000329", condition()) + ) + ) + Block("1700:l00000329", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000033c", condition()) + ) + ) + Block("1720:l0000025e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000033c", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/secret_write/clang_no_plt_no_pic/secret_write-before-analysis.il.expected b/src/test/correct/secret_write/clang_no_plt_no_pic/secret_write-before-analysis.il.expected new file mode 100644 index 000000000..35651033b --- /dev/null +++ b/src/test/correct/secret_write/clang_no_plt_no_pic/secret_write-before-analysis.il.expected @@ -0,0 +1,315 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008b4", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000093d", condition()) + ) + ) + Block("1752:l0000093d", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000094b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000964", condition()) + ) + ) + Block("1764:l00000964", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000094b", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000957", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008b4", condition()) + ) + ) + Block("1788:l000008b4", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b46", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007de", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000bd7", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000007f4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000009b4", condition()) + ) + ) + Block("1604:l000007f4", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000009b4", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000839", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000996", condition()) + ) + ) + Block("1640:l00000996", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000839", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009a9", condition()) + ) + ) + Block("1660:l00000839", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009a9", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 60bv64)] := Extract(Register(R10, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 60bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000978", condition()) + ) + ) + Block("1700:l00000978", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000098b", condition()) + ) + ) + Block("1720:l00000875", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000098b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/secret_write/clang_pic/secret_write-before-analysis.il.expected b/src/test/correct/secret_write/clang_pic/secret_write-before-analysis.il.expected new file mode 100644 index 000000000..0000d68f5 --- /dev/null +++ b/src/test/correct/secret_write/clang_pic/secret_write-before-analysis.il.expected @@ -0,0 +1,318 @@ +Procedure("1552:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002c9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000367", condition()) + ) + ) + Block("1816:l00000367", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4016bv64)])) + ), + jumps( + GoTo("1840:l00000375", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000038e", condition()) + ) + ) + Block("1828:l0000038e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1552:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000375", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000381", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002c9", condition()) + ) + ) + Block("1852:l000002c9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1948:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1948:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1480:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1480:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1496bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1496:l00000573", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1536:__libc_start_main", condition()) + ) + ) + Block("1648:l000001f3", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1584:abort", condition()) + ) + ) + Block("?:l00000629", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1584:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1668:l00000209", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003de", condition()) + ) + ) + Block("1668:l00000209", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003de", + statements( + ), + jumps( + GoTo("1568:l__gmon_start__", condition()) + ) + ) + Block("1568:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003c0", condition()) + ) + ) + Block("1704:l000003c0", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4008bv64)])) + ), + jumps( + GoTo("1724:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003d3", condition()) + ) + ) + Block("1724:l0000024e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003d3", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4024bv64)])) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R9, bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4048bv64)])) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R10, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R9, bv64)]), 32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003a2", condition()) + ) + ) + Block("1764:l000003a2", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003b5", condition()) + ) + ) + Block("1784:l0000028a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003b5", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/secret_write/gcc/secret_write-before-analysis.il.expected b/src/test/correct/secret_write/gcc/secret_write-before-analysis.il.expected new file mode 100644 index 000000000..bf6d5b4e6 --- /dev/null +++ b/src/test/correct/secret_write/gcc/secret_write-before-analysis.il.expected @@ -0,0 +1,328 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002f1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000003c3", condition()) + ) + ) + Block("1752:l000003c3", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000003d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003ea", condition()) + ) + ) + Block("1764:l000003ea", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000003d1", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000003dd", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002f1", condition()) + ) + ) + Block("1788:l000002f1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1924:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1924:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000005d9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000021b", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000699", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000231", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000043a", condition()) + ) + ) + Block("1604:l00000231", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000043a", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000041c", condition()) + ) + ) + Block("1640:l0000041c", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000042f", condition()) + ) + ) + Block("1660:l00000276", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000042f", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 28bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000002b2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003fe", condition()) + ) + ) + Block("1700:l000003fe", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000002b2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000411", condition()) + ) + ) + Block("1720:l000002b2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000411", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/secret_write/gcc_O2/secret_write-before-analysis.il.expected b/src/test/correct/secret_write/gcc_O2/secret_write-before-analysis.il.expected new file mode 100644 index 000000000..ababc3d28 --- /dev/null +++ b/src/test/correct/secret_write/gcc_O2/secret_write-before-analysis.il.expected @@ -0,0 +1,307 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002fc", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000325", condition()) + ) + ) + Block("1816:l00000325", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l00000333", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000034c", condition()) + ) + ) + Block("1828:l0000034c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000333", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000033f", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002fc", condition()) + ) + ) + Block("1852:l000002fc", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l0000052f", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000226", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005e3", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l0000023c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000039c", condition()) + ) + ) + Block("1668:l0000023c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000039c", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000281", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000037e", condition()) + ) + ) + Block("1704:l0000037e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000281", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000391", condition()) + ) + ) + Block("1724:l00000281", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000391", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) + LocalAssign(Register(R3, bv64) := 2bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R2, bv64), 4bv64)] := Extract(Register(R3, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000360", condition()) + ) + ) + Block("1764:l00000360", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000373", condition()) + ) + ) + Block("1784:l000002bd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000373", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/secret_write/gcc_no_plt_no_pic/secret_write-before-analysis.il.expected b/src/test/correct/secret_write/gcc_no_plt_no_pic/secret_write-before-analysis.il.expected new file mode 100644 index 000000000..a47910220 --- /dev/null +++ b/src/test/correct/secret_write/gcc_no_plt_no_pic/secret_write-before-analysis.il.expected @@ -0,0 +1,328 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000097f", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000a51", condition()) + ) + ) + Block("1752:l00000a51", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000a5f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000a78", condition()) + ) + ) + Block("1764:l00000a78", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000a5f", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000a6b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000097f", condition()) + ) + ) + Block("1788:l0000097f", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1924:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1924:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000c67", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000008a9", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000d05", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000008bf", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000ac8", condition()) + ) + ) + Block("1604:l000008bf", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000ac8", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000904", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000aaa", condition()) + ) + ) + Block("1640:l00000aaa", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000904", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000abd", condition()) + ) + ) + Block("1660:l00000904", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000abd", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 28bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000940", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000a8c", condition()) + ) + ) + Block("1700:l00000a8c", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000940", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000a9f", condition()) + ) + ) + Block("1720:l00000940", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000a9f", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/secret_write/gcc_pic/secret_write-before-analysis.il.expected b/src/test/correct/secret_write/gcc_pic/secret_write-before-analysis.il.expected new file mode 100644 index 000000000..476e0f916 --- /dev/null +++ b/src/test/correct/secret_write/gcc_pic/secret_write-before-analysis.il.expected @@ -0,0 +1,328 @@ +Procedure("1552:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000003cb", condition()) + ) + ) + Block("1816:l000003cb", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1840:l000003d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l000003f2", condition()) + ) + ) + Block("1828:l000003f2", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1552:__cxa_finalize", condition()) + ) + ) + Block("1840:l000003d9", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000003e5", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f1", condition()) + ) + ) + Block("1852:l000002f1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1988:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1988:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1480:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1480:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1496bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1496:l000005e1", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1536:__libc_start_main", condition()) + ) + ) + Block("1648:l0000021b", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1584:abort", condition()) + ) + ) + Block("?:l000006a1", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1584:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1668:l00000231", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000442", condition()) + ) + ) + Block("1668:l00000231", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000442", + statements( + ), + jumps( + GoTo("1568:l__gmon_start__", condition()) + ) + ) + Block("1568:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000424", condition()) + ) + ) + Block("1704:l00000424", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1724:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000437", condition()) + ) + ) + Block("1724:l00000276", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000437", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002b2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000406", condition()) + ) + ) + Block("1764:l00000406", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002b2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000419", condition()) + ) + ) + Block("1784:l000002b2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000419", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/simple_jump/clang/simple_jump-before-analysis.il.expected b/src/test/correct/simple_jump/clang/simple_jump-before-analysis.il.expected new file mode 100644 index 000000000..d4c21d9c3 --- /dev/null +++ b/src/test/correct/simple_jump/clang/simple_jump-before-analysis.il.expected @@ -0,0 +1,362 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000360", condition()) + ) + ) + Block("1752:l00000360", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000036e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000387", condition()) + ) + ) + Block("1764:l00000387", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000036e", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000037a", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002bd", condition()) + ) + ) + Block("1788:l000002bd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000569", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001e7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000061d", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003d7", condition()) + ) + ) + Block("1604:l000001fd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003d7", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003b9", condition()) + ) + ) + Block("1640:l000003b9", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003cc", condition()) + ) + ) + Block("1660:l00000242", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003cc", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967290bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934587bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967291bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000326", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000329", condition()) + ) + ) + Block("?:l00000329", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l0000032c", condition()) + ) + ) + Block("?:l00000326", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l0000032c", condition()) + ) + ) + Block("?:l0000032c", + statements( + ), + jumps( + GoTo("1860:l00000334", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1844:l0000034b", condition()) + ) + ) + Block("1844:l0000034b", + statements( + ), + jumps( + GoTo("1848:l0000034c", condition()) + ) + ) + Block("1848:l0000034c", + statements( + LocalAssign(Register(R8, bv64) := 6bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1860:l00000334", condition()) + ) + ) + Block("1860:l00000334", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000039b", condition()) + ) + ) + Block("1700:l0000039b", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003ae", condition()) + ) + ) + Block("1720:l0000027e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003ae", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/simple_jump/clang_O2/simple_jump-before-analysis.il.expected b/src/test/correct/simple_jump/clang_O2/simple_jump-before-analysis.il.expected new file mode 100644 index 000000000..5a5a5bf1d --- /dev/null +++ b/src/test/correct/simple_jump/clang_O2/simple_jump-before-analysis.il.expected @@ -0,0 +1,302 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000289", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002bc", condition()) + ) + ) + Block("1752:l000002bc", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000002e3", condition()) + ) + ) + Block("1764:l000002e3", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002ca", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002d6", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000289", condition()) + ) + ) + Block("1788:l00000289", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1820:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1820:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004b8", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001b3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000055e", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001c9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000333", condition()) + ) + ) + Block("1604:l000001c9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000333", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000020e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000315", condition()) + ) + ) + Block("1640:l00000315", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000020e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000328", condition()) + ) + ) + Block("1660:l0000020e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000328", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000002f7", condition()) + ) + ) + Block("1700:l000002f7", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000030a", condition()) + ) + ) + Block("1720:l0000024a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000030a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/simple_jump/clang_no_plt_no_pic/simple_jump-before-analysis.il.expected b/src/test/correct/simple_jump/clang_no_plt_no_pic/simple_jump-before-analysis.il.expected new file mode 100644 index 000000000..aa9a322fd --- /dev/null +++ b/src/test/correct/simple_jump/clang_no_plt_no_pic/simple_jump-before-analysis.il.expected @@ -0,0 +1,362 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008cf", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000972", condition()) + ) + ) + Block("1752:l00000972", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000980", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000999", condition()) + ) + ) + Block("1764:l00000999", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000980", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000098c", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008cf", condition()) + ) + ) + Block("1788:l000008cf", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b7b", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007f9", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c0c", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000080f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000009e9", condition()) + ) + ) + Block("1604:l0000080f", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000009e9", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000854", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009cb", condition()) + ) + ) + Block("1640:l000009cb", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000854", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009de", condition()) + ) + ) + Block("1660:l00000854", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009de", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967290bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934587bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967291bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000938", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l0000093b", condition()) + ) + ) + Block("?:l0000093b", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l0000093e", condition()) + ) + ) + Block("?:l00000938", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l0000093e", condition()) + ) + ) + Block("?:l0000093e", + statements( + ), + jumps( + GoTo("1860:l00000946", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1844:l0000095d", condition()) + ) + ) + Block("1844:l0000095d", + statements( + ), + jumps( + GoTo("1848:l0000095e", condition()) + ) + ) + Block("1848:l0000095e", + statements( + LocalAssign(Register(R8, bv64) := 6bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1860:l00000946", condition()) + ) + ) + Block("1860:l00000946", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000890", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009ad", condition()) + ) + ) + Block("1700:l000009ad", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000890", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009c0", condition()) + ) + ) + Block("1720:l00000890", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009c0", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/simple_jump/clang_pic/simple_jump-before-analysis.il.expected b/src/test/correct/simple_jump/clang_pic/simple_jump-before-analysis.il.expected new file mode 100644 index 000000000..aa9a322fd --- /dev/null +++ b/src/test/correct/simple_jump/clang_pic/simple_jump-before-analysis.il.expected @@ -0,0 +1,362 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008cf", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000972", condition()) + ) + ) + Block("1752:l00000972", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000980", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000999", condition()) + ) + ) + Block("1764:l00000999", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000980", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000098c", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008cf", condition()) + ) + ) + Block("1788:l000008cf", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b7b", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007f9", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c0c", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000080f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000009e9", condition()) + ) + ) + Block("1604:l0000080f", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000009e9", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000854", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009cb", condition()) + ) + ) + Block("1640:l000009cb", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000854", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009de", condition()) + ) + ) + Block("1660:l00000854", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009de", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967290bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934587bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967291bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000938", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l0000093b", condition()) + ) + ) + Block("?:l0000093b", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l0000093e", condition()) + ) + ) + Block("?:l00000938", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l0000093e", condition()) + ) + ) + Block("?:l0000093e", + statements( + ), + jumps( + GoTo("1860:l00000946", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1844:l0000095d", condition()) + ) + ) + Block("1844:l0000095d", + statements( + ), + jumps( + GoTo("1848:l0000095e", condition()) + ) + ) + Block("1848:l0000095e", + statements( + LocalAssign(Register(R8, bv64) := 6bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1860:l00000946", condition()) + ) + ) + Block("1860:l00000946", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000890", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009ad", condition()) + ) + ) + Block("1700:l000009ad", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000890", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009c0", condition()) + ) + ) + Block("1720:l00000890", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009c0", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/simple_jump/gcc/simple_jump-before-analysis.il.expected b/src/test/correct/simple_jump/gcc/simple_jump-before-analysis.il.expected new file mode 100644 index 000000000..1ca93c719 --- /dev/null +++ b/src/test/correct/simple_jump/gcc/simple_jump-before-analysis.il.expected @@ -0,0 +1,329 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002ad", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000032c", condition()) + ) + ) + Block("1752:l0000032c", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l0000033a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000353", condition()) + ) + ) + Block("1764:l00000353", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000033a", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000346", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002ad", condition()) + ) + ) + Block("1788:l000002ad", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1856:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000531", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001d7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005e2", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000001ed", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003a3", condition()) + ) + ) + Block("1604:l000001ed", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003a3", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000232", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000385", condition()) + ) + ) + Block("1640:l00000385", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000232", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000398", condition()) + ) + ) + Block("1660:l00000232", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000398", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1844:l0000030a", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1836:l0000031f", condition()) + ) + ) + Block("1836:l0000031f", + statements( + LocalAssign(Register(R0, bv64) := 6bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1844:l0000030a", condition()) + ) + ) + Block("1844:l0000030a", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000026e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000367", condition()) + ) + ) + Block("1700:l00000367", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000026e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000037a", condition()) + ) + ) + Block("1720:l0000026e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000037a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/simple_jump/gcc_O2/simple_jump-before-analysis.il.expected b/src/test/correct/simple_jump/gcc_O2/simple_jump-before-analysis.il.expected new file mode 100644 index 000000000..82dc9ebf6 --- /dev/null +++ b/src/test/correct/simple_jump/gcc_O2/simple_jump-before-analysis.il.expected @@ -0,0 +1,302 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002e7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000310", condition()) + ) + ) + Block("1816:l00000310", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000031e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000337", condition()) + ) + ) + Block("1828:l00000337", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000031e", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000032a", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002e7", condition()) + ) + ) + Block("1852:l000002e7", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l0000051a", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000211", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005ce", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000227", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000387", condition()) + ) + ) + Block("1668:l00000227", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000387", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000026c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000369", condition()) + ) + ) + Block("1704:l00000369", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l0000026c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l0000037c", condition()) + ) + ) + Block("1724:l0000026c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l0000037c", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002a8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000034b", condition()) + ) + ) + Block("1764:l0000034b", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002a8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000035e", condition()) + ) + ) + Block("1784:l000002a8", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000035e", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/simple_jump/gcc_no_plt_no_pic/simple_jump-before-analysis.il.expected b/src/test/correct/simple_jump/gcc_no_plt_no_pic/simple_jump-before-analysis.il.expected new file mode 100644 index 000000000..db6fb9227 --- /dev/null +++ b/src/test/correct/simple_jump/gcc_no_plt_no_pic/simple_jump-before-analysis.il.expected @@ -0,0 +1,329 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000884", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000903", condition()) + ) + ) + Block("1752:l00000903", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000911", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000092a", condition()) + ) + ) + Block("1764:l0000092a", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000911", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000091d", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000884", condition()) + ) + ) + Block("1788:l00000884", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1856:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b08", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007ae", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000b95", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000007c4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000097a", condition()) + ) + ) + Block("1604:l000007c4", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000097a", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000809", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000095c", condition()) + ) + ) + Block("1640:l0000095c", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000809", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000096f", condition()) + ) + ) + Block("1660:l00000809", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000096f", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1844:l000008e1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1836:l000008f6", condition()) + ) + ) + Block("1836:l000008f6", + statements( + LocalAssign(Register(R0, bv64) := 6bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1844:l000008e1", condition()) + ) + ) + Block("1844:l000008e1", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000845", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000093e", condition()) + ) + ) + Block("1700:l0000093e", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000845", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000951", condition()) + ) + ) + Block("1720:l00000845", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000951", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/simple_jump/gcc_pic/simple_jump-before-analysis.il.expected b/src/test/correct/simple_jump/gcc_pic/simple_jump-before-analysis.il.expected new file mode 100644 index 000000000..db6fb9227 --- /dev/null +++ b/src/test/correct/simple_jump/gcc_pic/simple_jump-before-analysis.il.expected @@ -0,0 +1,329 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000884", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000903", condition()) + ) + ) + Block("1752:l00000903", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000911", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000092a", condition()) + ) + ) + Block("1764:l0000092a", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000911", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000091d", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000884", condition()) + ) + ) + Block("1788:l00000884", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1856:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b08", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007ae", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000b95", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000007c4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000097a", condition()) + ) + ) + Block("1604:l000007c4", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000097a", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000809", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000095c", condition()) + ) + ) + Block("1640:l0000095c", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000809", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000096f", condition()) + ) + ) + Block("1660:l00000809", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000096f", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1844:l000008e1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1836:l000008f6", condition()) + ) + ) + Block("1836:l000008f6", + statements( + LocalAssign(Register(R0, bv64) := 6bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1844:l000008e1", condition()) + ) + ) + Block("1844:l000008e1", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000845", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000093e", condition()) + ) + ) + Block("1700:l0000093e", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000845", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000951", condition()) + ) + ) + Block("1720:l00000845", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000951", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/switch/clang/switch-before-analysis.il.expected b/src/test/correct/switch/clang/switch-before-analysis.il.expected new file mode 100644 index 000000000..0a8c87422 --- /dev/null +++ b/src/test/correct/switch/clang/switch-before-analysis.il.expected @@ -0,0 +1,426 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002e9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000003ec", condition()) + ) + ) + Block("1752:l000003ec", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000003fa", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000413", condition()) + ) + ) + Block("1764:l00000413", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000003fa", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000406", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002e9", condition()) + ) + ) + Block("1788:l000002e9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1916:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1916:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000600", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000213", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000006c0", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000229", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000463", condition()) + ) + ) + Block("1604:l00000229", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000463", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000026e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000445", condition()) + ) + ) + Block("1640:l00000445", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000026e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000458", condition()) + ) + ) + Block("1660:l0000026e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000458", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l0000035a", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("?:l0000035d", condition()) + ) + ) + Block("?:l0000035d", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000360", condition()) + ) + ) + Block("?:l0000035a", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000360", condition()) + ) + ) + Block("?:l00000360", + statements( + ), + jumps( + GoTo("1884:l00000368", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1848:l0000039a", condition()) + ) + ) + Block("1848:l0000039a", + statements( + ), + jumps( + GoTo("1852:l0000039b", condition()) + ) + ) + Block("1852:l0000039b", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l000003c4", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l000003c7", condition()) + ) + ) + Block("?:l000003c7", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l000003ca", condition()) + ) + ) + Block("?:l000003c4", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l000003ca", condition()) + ) + ) + Block("?:l000003ca", + statements( + ), + jumps( + GoTo("1896:l00000389", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1868:l000003d7", condition()) + ) + ) + Block("1896:l00000389", + statements( + LocalAssign(Register(R8, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1908:l0000037b", condition()) + ) + ) + Block("1868:l000003d7", + statements( + ), + jumps( + GoTo("1872:l000003d8", condition()) + ) + ) + Block("1872:l000003d8", + statements( + LocalAssign(Register(R8, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1884:l00000368", condition()) + ) + ) + Block("1884:l00000368", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1908:l0000037b", condition()) + ) + ) + Block("1908:l0000037b", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000002aa", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000427", condition()) + ) + ) + Block("1700:l00000427", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000002aa", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000043a", condition()) + ) + ) + Block("1720:l000002aa", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000043a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/switch/clang_O2/switch-before-analysis.il.expected b/src/test/correct/switch/clang_O2/switch-before-analysis.il.expected new file mode 100644 index 000000000..af5bdc2a2 --- /dev/null +++ b/src/test/correct/switch/clang_O2/switch-before-analysis.il.expected @@ -0,0 +1,301 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000285", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002b3", condition()) + ) + ) + Block("1752:l000002b3", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000002da", condition()) + ) + ) + Block("1764:l000002da", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002c1", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002cd", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000285", condition()) + ) + ) + Block("1788:l00000285", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1816:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1816:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004ae", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001af", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000553", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001c5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000032a", condition()) + ) + ) + Block("1604:l000001c5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000032a", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000020a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000030c", condition()) + ) + ) + Block("1640:l0000030c", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000020a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000031f", condition()) + ) + ) + Block("1660:l0000020a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000031f", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000002ee", condition()) + ) + ) + Block("1700:l000002ee", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000301", condition()) + ) + ) + Block("1720:l00000246", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000301", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/switch/clang_no_plt_no_pic/switch-before-analysis.il.expected b/src/test/correct/switch/clang_no_plt_no_pic/switch-before-analysis.il.expected new file mode 100644 index 000000000..3009c2547 --- /dev/null +++ b/src/test/correct/switch/clang_no_plt_no_pic/switch-before-analysis.il.expected @@ -0,0 +1,426 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000099e", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000aa1", condition()) + ) + ) + Block("1752:l00000aa1", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000aaf", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000ac8", condition()) + ) + ) + Block("1764:l00000ac8", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000aaf", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000abb", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000099e", condition()) + ) + ) + Block("1788:l0000099e", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1916:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1916:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000cb5", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000008c8", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000d51", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000008de", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000b18", condition()) + ) + ) + Block("1604:l000008de", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000b18", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000923", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000afa", condition()) + ) + ) + Block("1640:l00000afa", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000923", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000b0d", condition()) + ) + ) + Block("1660:l00000923", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000b0d", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000a0f", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("?:l00000a12", condition()) + ) + ) + Block("?:l00000a12", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000a15", condition()) + ) + ) + Block("?:l00000a0f", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000a15", condition()) + ) + ) + Block("?:l00000a15", + statements( + ), + jumps( + GoTo("1884:l00000a1d", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1848:l00000a4f", condition()) + ) + ) + Block("1848:l00000a4f", + statements( + ), + jumps( + GoTo("1852:l00000a50", condition()) + ) + ) + Block("1852:l00000a50", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000a79", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000a7c", condition()) + ) + ) + Block("?:l00000a7c", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000a7f", condition()) + ) + ) + Block("?:l00000a79", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000a7f", condition()) + ) + ) + Block("?:l00000a7f", + statements( + ), + jumps( + GoTo("1896:l00000a3e", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1868:l00000a8c", condition()) + ) + ) + Block("1896:l00000a3e", + statements( + LocalAssign(Register(R8, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1908:l00000a30", condition()) + ) + ) + Block("1868:l00000a8c", + statements( + ), + jumps( + GoTo("1872:l00000a8d", condition()) + ) + ) + Block("1872:l00000a8d", + statements( + LocalAssign(Register(R8, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1884:l00000a1d", condition()) + ) + ) + Block("1884:l00000a1d", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1908:l00000a30", condition()) + ) + ) + Block("1908:l00000a30", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000095f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000adc", condition()) + ) + ) + Block("1700:l00000adc", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000095f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000aef", condition()) + ) + ) + Block("1720:l0000095f", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000aef", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/switch/clang_pic/switch-before-analysis.il.expected b/src/test/correct/switch/clang_pic/switch-before-analysis.il.expected new file mode 100644 index 000000000..3009c2547 --- /dev/null +++ b/src/test/correct/switch/clang_pic/switch-before-analysis.il.expected @@ -0,0 +1,426 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000099e", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000aa1", condition()) + ) + ) + Block("1752:l00000aa1", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000aaf", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000ac8", condition()) + ) + ) + Block("1764:l00000ac8", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000aaf", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000abb", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000099e", condition()) + ) + ) + Block("1788:l0000099e", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1916:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1916:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000cb5", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000008c8", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000d51", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000008de", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000b18", condition()) + ) + ) + Block("1604:l000008de", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000b18", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000923", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000afa", condition()) + ) + ) + Block("1640:l00000afa", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000923", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000b0d", condition()) + ) + ) + Block("1660:l00000923", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000b0d", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000a0f", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("?:l00000a12", condition()) + ) + ) + Block("?:l00000a12", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000a15", condition()) + ) + ) + Block("?:l00000a0f", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000a15", condition()) + ) + ) + Block("?:l00000a15", + statements( + ), + jumps( + GoTo("1884:l00000a1d", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1848:l00000a4f", condition()) + ) + ) + Block("1848:l00000a4f", + statements( + ), + jumps( + GoTo("1852:l00000a50", condition()) + ) + ) + Block("1852:l00000a50", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000a79", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000a7c", condition()) + ) + ) + Block("?:l00000a7c", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000a7f", condition()) + ) + ) + Block("?:l00000a79", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000a7f", condition()) + ) + ) + Block("?:l00000a7f", + statements( + ), + jumps( + GoTo("1896:l00000a3e", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1868:l00000a8c", condition()) + ) + ) + Block("1896:l00000a3e", + statements( + LocalAssign(Register(R8, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1908:l00000a30", condition()) + ) + ) + Block("1868:l00000a8c", + statements( + ), + jumps( + GoTo("1872:l00000a8d", condition()) + ) + ) + Block("1872:l00000a8d", + statements( + LocalAssign(Register(R8, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1884:l00000a1d", condition()) + ) + ) + Block("1884:l00000a1d", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1908:l00000a30", condition()) + ) + ) + Block("1908:l00000a30", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000095f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000adc", condition()) + ) + ) + Block("1700:l00000adc", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000095f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000aef", condition()) + ) + ) + Block("1720:l0000095f", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000aef", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/switch/gcc/switch-before-analysis.il.expected b/src/test/correct/switch/gcc/switch-before-analysis.il.expected new file mode 100644 index 000000000..7fd8df680 --- /dev/null +++ b/src/test/correct/switch/gcc/switch-before-analysis.il.expected @@ -0,0 +1,361 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000039e", condition()) + ) + ) + Block("1752:l0000039e", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000003ac", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003c5", condition()) + ) + ) + Block("1764:l000003c5", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000003ac", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000003b8", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002d5", condition()) + ) + ) + Block("1788:l000002d5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1896:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000005ad", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001ff", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000066a", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000415", condition()) + ) + ) + Block("1604:l00000215", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000415", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003f7", condition()) + ) + ) + Block("1640:l000003f7", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000040a", condition()) + ) + ) + Block("1660:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000040a", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1860:l00000339", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1840:l0000036b", condition()) + ) + ) + Block("1840:l0000036b", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1872:l0000035c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1852:l00000391", condition()) + ) + ) + Block("1872:l0000035c", + statements( + LocalAssign(Register(R0, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1884:l0000034c", condition()) + ) + ) + Block("1852:l00000391", + statements( + LocalAssign(Register(R0, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1860:l00000339", condition()) + ) + ) + Block("1860:l00000339", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1884:l0000034c", condition()) + ) + ) + Block("1884:l0000034c", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003d9", condition()) + ) + ) + Block("1700:l000003d9", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003ec", condition()) + ) + ) + Block("1720:l00000296", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003ec", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/switch/gcc_O2/switch-before-analysis.il.expected b/src/test/correct/switch/gcc_O2/switch-before-analysis.il.expected new file mode 100644 index 000000000..7387e4ace --- /dev/null +++ b/src/test/correct/switch/gcc_O2/switch-before-analysis.il.expected @@ -0,0 +1,301 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002e4", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000030d", condition()) + ) + ) + Block("1816:l0000030d", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000031b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000334", condition()) + ) + ) + Block("1828:l00000334", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000031b", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000327", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002e4", condition()) + ) + ) + Block("1852:l000002e4", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l00000517", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l0000020e", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005cb", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000224", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000384", condition()) + ) + ) + Block("1668:l00000224", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000384", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000269", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000366", condition()) + ) + ) + Block("1704:l00000366", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000269", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000379", condition()) + ) + ) + Block("1724:l00000269", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000379", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002a5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000348", condition()) + ) + ) + Block("1764:l00000348", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002a5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000035b", condition()) + ) + ) + Block("1784:l000002a5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000035b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/switch/gcc_no_plt_no_pic/switch-before-analysis.il.expected b/src/test/correct/switch/gcc_no_plt_no_pic/switch-before-analysis.il.expected new file mode 100644 index 000000000..ce585fc5b --- /dev/null +++ b/src/test/correct/switch/gcc_no_plt_no_pic/switch-before-analysis.il.expected @@ -0,0 +1,361 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000934", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000009fd", condition()) + ) + ) + Block("1752:l000009fd", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000a0b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000a24", condition()) + ) + ) + Block("1764:l00000a24", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000a0b", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000a17", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000934", condition()) + ) + ) + Block("1788:l00000934", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1896:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000c0c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000085e", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000ca3", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000874", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a74", condition()) + ) + ) + Block("1604:l00000874", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a74", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000008b9", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000a56", condition()) + ) + ) + Block("1640:l00000a56", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l000008b9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a69", condition()) + ) + ) + Block("1660:l000008b9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a69", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1860:l00000998", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1840:l000009ca", condition()) + ) + ) + Block("1840:l000009ca", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1872:l000009bb", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1852:l000009f0", condition()) + ) + ) + Block("1872:l000009bb", + statements( + LocalAssign(Register(R0, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1884:l000009ab", condition()) + ) + ) + Block("1852:l000009f0", + statements( + LocalAssign(Register(R0, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1860:l00000998", condition()) + ) + ) + Block("1860:l00000998", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1884:l000009ab", condition()) + ) + ) + Block("1884:l000009ab", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008f5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000a38", condition()) + ) + ) + Block("1700:l00000a38", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000008f5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000a4b", condition()) + ) + ) + Block("1720:l000008f5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000a4b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/switch/gcc_pic/switch-before-analysis.il.expected b/src/test/correct/switch/gcc_pic/switch-before-analysis.il.expected new file mode 100644 index 000000000..ce585fc5b --- /dev/null +++ b/src/test/correct/switch/gcc_pic/switch-before-analysis.il.expected @@ -0,0 +1,361 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000934", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000009fd", condition()) + ) + ) + Block("1752:l000009fd", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000a0b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000a24", condition()) + ) + ) + Block("1764:l00000a24", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000a0b", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000a17", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000934", condition()) + ) + ) + Block("1788:l00000934", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1896:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000c0c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000085e", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000ca3", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000874", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a74", condition()) + ) + ) + Block("1604:l00000874", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a74", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000008b9", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000a56", condition()) + ) + ) + Block("1640:l00000a56", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l000008b9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a69", condition()) + ) + ) + Block("1660:l000008b9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a69", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1860:l00000998", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1840:l000009ca", condition()) + ) + ) + Block("1840:l000009ca", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1872:l000009bb", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1852:l000009f0", condition()) + ) + ) + Block("1872:l000009bb", + statements( + LocalAssign(Register(R0, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1884:l000009ab", condition()) + ) + ) + Block("1852:l000009f0", + statements( + LocalAssign(Register(R0, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1860:l00000998", condition()) + ) + ) + Block("1860:l00000998", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1884:l000009ab", condition()) + ) + ) + Block("1884:l000009ab", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008f5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000a38", condition()) + ) + ) + Block("1700:l00000a38", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000008f5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000a4b", condition()) + ) + ) + Block("1720:l000008f5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000a4b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/switch2/clang_O2/switch2-before-analysis.il.expected b/src/test/correct/switch2/clang_O2/switch2-before-analysis.il.expected new file mode 100644 index 000000000..c260ea2e5 --- /dev/null +++ b/src/test/correct/switch2/clang_O2/switch2-before-analysis.il.expected @@ -0,0 +1,311 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000028d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002c5", condition()) + ) + ) + Block("1752:l000002c5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002d3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000002ec", condition()) + ) + ) + Block("1764:l000002ec", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002d3", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002df", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000028d", condition()) + ) + ) + Block("1788:l0000028d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1824:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1824:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004c2", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001b7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000056b", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000033c", condition()) + ) + ) + Block("1604:l000001cd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000033c", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000212", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000031e", condition()) + ) + ) + Block("1640:l0000031e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000212", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000331", condition()) + ) + ) + Block("1660:l00000212", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000331", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1820:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1820:lmain", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1812:r", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1812:lr", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000300", condition()) + ) + ) + Block("1700:l00000300", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000313", condition()) + ) + ) + Block("1720:l0000024e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000313", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/switch2/gcc/switch2-before-analysis.il.expected b/src/test/correct/switch2/gcc/switch2-before-analysis.il.expected new file mode 100644 index 000000000..e4d88c7f3 --- /dev/null +++ b/src/test/correct/switch2/gcc/switch2-before-analysis.il.expected @@ -0,0 +1,502 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000349", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000055a", condition()) + ) + ) + Block("1752:l0000055a", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000568", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000581", condition()) + ) + ) + Block("1764:l00000581", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000568", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000574", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000349", condition()) + ) + ) + Block("1788:l00000349", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2012:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2012:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#14, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#14, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#14, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#14, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000786", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000273", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000086a", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000289", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000005d1", condition()) + ) + ) + Block("1604:l00000289", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000005d1", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000002ce", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000005b3", condition()) + ) + ) + Block("1640:l000005b3", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l000002ce", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000005c6", condition()) + ) + ) + Block("1660:l000002ce", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000005c6", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1820:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1820:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1980:l000003d0", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1852:l00000408", condition()) + ) + ) + Block("1980:l000003d0", + statements( + LocalAssign(Register(R0, bv64) := 4bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1988:l000003e2", condition()) + ) + ) + Block("1852:l00000408", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1988:l000003e2", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("1864:l00000430", condition()) + ) + ) + Block("1864:l00000430", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#7, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#7, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1968:l00000451", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1876:l00000467", condition()) + ) + ) + Block("1876:l00000467", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#8, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#8, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1988:l000003e2", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("1888:l0000048f", condition()) + ) + ) + Block("1888:l0000048f", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#9, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#9, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1940:l000004b0", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1900:l000004e2", condition()) + ) + ) + Block("1940:l000004b0", + statements( + LocalAssign(Register(R30, bv64) := 1944bv64) + ), + jumps( + DirectCall("1812:r", condition()) + ) + ) + Block("1944:l000004bc", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1948:l000004c4", condition()) + ) + ) + Block("1900:l000004e2", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#10, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#10, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1988:l000003e2", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("1912:l0000050a", condition()) + ) + ) + Block("1912:l0000050a", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#11, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#11, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1948:l000004c4", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1924:l00000530", condition()) + ) + ) + Block("1948:l000004c4", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("2000:l000003f1", condition()) + ) + ) + Block("1924:l00000530", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#12, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#12, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1960:l000004d5", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1936:l00000556", condition()) + ) + ) + Block("1960:l000004d5", + statements( + LocalAssign(Register(R0, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1968:l00000451", condition()) + ) + ) + Block("1968:l00000451", + statements( + LocalAssign(Register(R0, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("2000:l000003f1", condition()) + ) + ) + Block("1936:l00000556", + statements( + ), + jumps( + GoTo("1988:l000003e2", condition()) + ) + ) + Block("1988:l000003e2", + statements( + LocalAssign(Register(R0, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("2000:l000003f1", condition()) + ) + ) + Block("2000:l000003f1", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1812:r", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1812:lr", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000030a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000595", condition()) + ) + ) + Block("1700:l00000595", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000030a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000005a8", condition()) + ) + ) + Block("1720:l0000030a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000005a8", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/switch2/gcc_O2/switch2-before-analysis.il.expected b/src/test/correct/switch2/gcc_O2/switch2-before-analysis.il.expected new file mode 100644 index 000000000..af71c353c --- /dev/null +++ b/src/test/correct/switch2/gcc_O2/switch2-before-analysis.il.expected @@ -0,0 +1,311 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000331", condition()) + ) + ) + Block("1816:l00000331", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000033f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000358", condition()) + ) + ) + Block("1828:l00000358", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000033f", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000034b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f8", condition()) + ) + ) + Block("1852:l000002f8", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1896:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l00000540", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000222", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005fb", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000238", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003a8", condition()) + ) + ) + Block("1668:l00000238", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003a8", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000027d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000038a", condition()) + ) + ) + Block("1704:l0000038a", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l0000027d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l0000039d", condition()) + ) + ) + Block("1724:l0000027d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l0000039d", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1888:r", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1888:lr", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002b9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000036c", condition()) + ) + ) + Block("1764:l0000036c", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002b9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000037f", condition()) + ) + ) + Block("1784:l000002b9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000037f", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/switch2/gcc_no_plt_no_pic/switch2-before-analysis.il.expected b/src/test/correct/switch2/gcc_no_plt_no_pic/switch2-before-analysis.il.expected new file mode 100644 index 000000000..ede52bf68 --- /dev/null +++ b/src/test/correct/switch2/gcc_no_plt_no_pic/switch2-before-analysis.il.expected @@ -0,0 +1,502 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000ba8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000db9", condition()) + ) + ) + Block("1752:l00000db9", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000dc7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000de0", condition()) + ) + ) + Block("1764:l00000de0", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000dc7", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000dd3", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000ba8", condition()) + ) + ) + Block("1788:l00000ba8", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2012:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2012:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#14, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#14, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#14, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#14, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000fe5", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000ad2", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00001099", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000ae8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000e30", condition()) + ) + ) + Block("1604:l00000ae8", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000e30", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000b2d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000e12", condition()) + ) + ) + Block("1640:l00000e12", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000b2d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000e25", condition()) + ) + ) + Block("1660:l00000b2d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000e25", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1820:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1820:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1980:l00000c2f", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1852:l00000c67", condition()) + ) + ) + Block("1980:l00000c2f", + statements( + LocalAssign(Register(R0, bv64) := 4bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1988:l00000c41", condition()) + ) + ) + Block("1852:l00000c67", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1988:l00000c41", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("1864:l00000c8f", condition()) + ) + ) + Block("1864:l00000c8f", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#7, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#7, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1968:l00000cb0", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1876:l00000cc6", condition()) + ) + ) + Block("1876:l00000cc6", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#8, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#8, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1988:l00000c41", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("1888:l00000cee", condition()) + ) + ) + Block("1888:l00000cee", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#9, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#9, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1940:l00000d0f", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1900:l00000d41", condition()) + ) + ) + Block("1940:l00000d0f", + statements( + LocalAssign(Register(R30, bv64) := 1944bv64) + ), + jumps( + DirectCall("1812:r", condition()) + ) + ) + Block("1944:l00000d1b", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1948:l00000d23", condition()) + ) + ) + Block("1900:l00000d41", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#10, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#10, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1988:l00000c41", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("1912:l00000d69", condition()) + ) + ) + Block("1912:l00000d69", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#11, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#11, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1948:l00000d23", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1924:l00000d8f", condition()) + ) + ) + Block("1948:l00000d23", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("2000:l00000c50", condition()) + ) + ) + Block("1924:l00000d8f", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#12, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#12, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1960:l00000d34", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1936:l00000db5", condition()) + ) + ) + Block("1960:l00000d34", + statements( + LocalAssign(Register(R0, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1968:l00000cb0", condition()) + ) + ) + Block("1968:l00000cb0", + statements( + LocalAssign(Register(R0, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("2000:l00000c50", condition()) + ) + ) + Block("1936:l00000db5", + statements( + ), + jumps( + GoTo("1988:l00000c41", condition()) + ) + ) + Block("1988:l00000c41", + statements( + LocalAssign(Register(R0, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("2000:l00000c50", condition()) + ) + ) + Block("2000:l00000c50", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1812:r", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1812:lr", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000b69", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000df4", condition()) + ) + ) + Block("1700:l00000df4", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000b69", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000e07", condition()) + ) + ) + Block("1720:l00000b69", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000e07", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/switch2/gcc_pic/switch2-before-analysis.il.expected b/src/test/correct/switch2/gcc_pic/switch2-before-analysis.il.expected new file mode 100644 index 000000000..ede52bf68 --- /dev/null +++ b/src/test/correct/switch2/gcc_pic/switch2-before-analysis.il.expected @@ -0,0 +1,502 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000ba8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000db9", condition()) + ) + ) + Block("1752:l00000db9", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000dc7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000de0", condition()) + ) + ) + Block("1764:l00000de0", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000dc7", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000dd3", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000ba8", condition()) + ) + ) + Block("1788:l00000ba8", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2012:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2012:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#14, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#14, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#14, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#14, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000fe5", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000ad2", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00001099", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000ae8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000e30", condition()) + ) + ) + Block("1604:l00000ae8", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000e30", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000b2d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000e12", condition()) + ) + ) + Block("1640:l00000e12", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000b2d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000e25", condition()) + ) + ) + Block("1660:l00000b2d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000e25", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1820:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1820:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1980:l00000c2f", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1852:l00000c67", condition()) + ) + ) + Block("1980:l00000c2f", + statements( + LocalAssign(Register(R0, bv64) := 4bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1988:l00000c41", condition()) + ) + ) + Block("1852:l00000c67", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1988:l00000c41", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("1864:l00000c8f", condition()) + ) + ) + Block("1864:l00000c8f", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#7, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#7, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1968:l00000cb0", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1876:l00000cc6", condition()) + ) + ) + Block("1876:l00000cc6", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#8, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#8, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1988:l00000c41", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("1888:l00000cee", condition()) + ) + ) + Block("1888:l00000cee", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#9, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#9, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1940:l00000d0f", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1900:l00000d41", condition()) + ) + ) + Block("1940:l00000d0f", + statements( + LocalAssign(Register(R30, bv64) := 1944bv64) + ), + jumps( + DirectCall("1812:r", condition()) + ) + ) + Block("1944:l00000d1b", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1948:l00000d23", condition()) + ) + ) + Block("1900:l00000d41", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#10, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#10, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1988:l00000c41", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) + GoTo("1912:l00000d69", condition()) + ) + ) + Block("1912:l00000d69", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#11, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#11, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1948:l00000d23", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1924:l00000d8f", condition()) + ) + ) + Block("1948:l00000d23", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("2000:l00000c50", condition()) + ) + ) + Block("1924:l00000d8f", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#12, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#12, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1960:l00000d34", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1936:l00000db5", condition()) + ) + ) + Block("1960:l00000d34", + statements( + LocalAssign(Register(R0, bv64) := 2bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1968:l00000cb0", condition()) + ) + ) + Block("1968:l00000cb0", + statements( + LocalAssign(Register(R0, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("2000:l00000c50", condition()) + ) + ) + Block("1936:l00000db5", + statements( + ), + jumps( + GoTo("1988:l00000c41", condition()) + ) + ) + Block("1988:l00000c41", + statements( + LocalAssign(Register(R0, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("2000:l00000c50", condition()) + ) + ) + Block("2000:l00000c50", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1812:r", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1812:lr", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000b69", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000df4", condition()) + ) + ) + Block("1700:l00000df4", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000b69", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000e07", condition()) + ) + ) + Block("1720:l00000b69", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000e07", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/syscall/clang/syscall-before-analysis.il.expected b/src/test/correct/syscall/clang/syscall-before-analysis.il.expected new file mode 100644 index 000000000..89ba9d357 --- /dev/null +++ b/src/test/correct/syscall/clang/syscall-before-analysis.il.expected @@ -0,0 +1,325 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002b1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000341", condition()) + ) + ) + Block("1816:l00000341", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1840:l0000034f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000368", condition()) + ) + ) + Block("1828:l00000368", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000034f", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000035b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002b1", condition()) + ) + ) + Block("1852:l000002b1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1924:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1924:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1464:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1480bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1480:l0000056d", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001db", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1584:abort", condition()) + ) + ) + Block("?:l00000623", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1584:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l000001f1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003b8", condition()) + ) + ) + Block("1668:l000001f1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003b8", + statements( + ), + jumps( + GoTo("1568:l__gmon_start__", condition()) + ) + ) + Block("1568:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000236", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000039a", condition()) + ) + ) + Block("1704:l0000039a", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1724:l00000236", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003ad", condition()) + ) + ) + Block("1724:l00000236", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003ad", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1552:fork", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551608bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) + LocalAssign(Register(R30, bv64) := 1904bv64) + ), + jumps( + DirectCall("1552:fork", condition()) + ) + ) + Block("1904:l00000317", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000272", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000037c", condition()) + ) + ) + Block("1764:l0000037c", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l00000272", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000038f", condition()) + ) + ) + Block("1784:l00000272", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000038f", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/syscall/clang_no_plt_no_pic/syscall-before-analysis.il.expected b/src/test/correct/syscall/clang_no_plt_no_pic/syscall-before-analysis.il.expected new file mode 100644 index 000000000..7699f5ba7 --- /dev/null +++ b/src/test/correct/syscall/clang_no_plt_no_pic/syscall-before-analysis.il.expected @@ -0,0 +1,325 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) + ), + jumps( + GoTo("1852:l000008c9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000959", condition()) + ) + ) + Block("1816:l00000959", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1840:l00000967", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000980", condition()) + ) + ) + Block("1828:l00000980", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000967", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000973", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000008c9", condition()) + ) + ) + Block("1852:l000008c9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1924:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1924:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1464:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1480bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1480:l00000b85", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000007f3", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1584:abort", condition()) + ) + ) + Block("?:l00000c17", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1584:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l00000809", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000009d0", condition()) + ) + ) + Block("1668:l00000809", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000009d0", + statements( + ), + jumps( + GoTo("1568:l__gmon_start__", condition()) + ) + ) + Block("1568:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000084e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000009b2", condition()) + ) + ) + Block("1704:l000009b2", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1724:l0000084e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000009c5", condition()) + ) + ) + Block("1724:l0000084e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000009c5", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1552:fork", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551608bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) + LocalAssign(Register(R30, bv64) := 1904bv64) + ), + jumps( + DirectCall("1552:fork", condition()) + ) + ) + Block("1904:l0000092f", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000088a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000994", condition()) + ) + ) + Block("1764:l00000994", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l0000088a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000009a7", condition()) + ) + ) + Block("1784:l0000088a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000009a7", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/syscall/clang_pic/syscall-before-analysis.il.expected b/src/test/correct/syscall/clang_pic/syscall-before-analysis.il.expected new file mode 100644 index 000000000..7699f5ba7 --- /dev/null +++ b/src/test/correct/syscall/clang_pic/syscall-before-analysis.il.expected @@ -0,0 +1,325 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) + ), + jumps( + GoTo("1852:l000008c9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000959", condition()) + ) + ) + Block("1816:l00000959", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1840:l00000967", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000980", condition()) + ) + ) + Block("1828:l00000980", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000967", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000973", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000008c9", condition()) + ) + ) + Block("1852:l000008c9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1924:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1924:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1464:l_init", + statements( + LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1480bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1480:l00000b85", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000007f3", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1584:abort", condition()) + ) + ) + Block("?:l00000c17", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1584:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l00000809", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000009d0", condition()) + ) + ) + Block("1668:l00000809", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000009d0", + statements( + ), + jumps( + GoTo("1568:l__gmon_start__", condition()) + ) + ) + Block("1568:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000084e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000009b2", condition()) + ) + ) + Block("1704:l000009b2", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1724:l0000084e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000009c5", condition()) + ) + ) + Block("1724:l0000084e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000009c5", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1552:fork", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551608bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) + LocalAssign(Register(R30, bv64) := 1904bv64) + ), + jumps( + DirectCall("1552:fork", condition()) + ) + ) + Block("1904:l0000092f", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000088a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000994", condition()) + ) + ) + Block("1764:l00000994", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l0000088a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000009a7", condition()) + ) + ) + Block("1784:l0000088a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000009a7", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/syscall/gcc/syscall-before-analysis.il.expected b/src/test/correct/syscall/gcc/syscall-before-analysis.il.expected new file mode 100644 index 000000000..83eb6010e --- /dev/null +++ b/src/test/correct/syscall/gcc/syscall-before-analysis.il.expected @@ -0,0 +1,323 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000326", condition()) + ) + ) + Block("1816:l00000326", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l00000334", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000034d", condition()) + ) + ) + Block("1828:l0000034d", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000334", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000340", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002a5", condition()) + ) + ) + Block("1852:l000002a5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1912:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1912:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1464:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1480bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1480:l0000054f", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001cf", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1584:abort", condition()) + ) + ) + Block("?:l00000602", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1584:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000039d", condition()) + ) + ) + Block("1668:l000001e5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000039d", + statements( + ), + jumps( + GoTo("1568:l__gmon_start__", condition()) + ) + ) + Block("1568:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000037f", condition()) + ) + ) + Block("1704:l0000037f", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000392", condition()) + ) + ) + Block("1724:l0000022a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000392", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1552:fork", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) + LocalAssign(Register(R30, bv64) := 1896bv64) + ), + jumps( + DirectCall("1552:fork", condition()) + ) + ) + Block("1896:l00000302", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 44bv64)]), 32)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000361", condition()) + ) + ) + Block("1764:l00000361", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000374", condition()) + ) + ) + Block("1784:l00000266", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000374", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/syscall/gcc_O2/syscall-before-analysis.il.expected b/src/test/correct/syscall/gcc_O2/syscall-before-analysis.il.expected new file mode 100644 index 000000000..e0bcb88ac --- /dev/null +++ b/src/test/correct/syscall/gcc_O2/syscall-before-analysis.il.expected @@ -0,0 +1,294 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1856:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1856:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1916:l000002e4", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1880:l0000030d", condition()) + ) + ) + Block("1880:l0000030d", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1904:l0000031b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1892:l00000334", condition()) + ) + ) + Block("1892:l00000334", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1904bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1904:l0000031b", + statements( + LocalAssign(Register(R30, bv64) := 1908bv64) + ), + jumps( + DirectCall("1744:deregister_tm_clones", condition()) + ) + ) + Block("1908:l00000327", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1916:l000002e4", condition()) + ) + ) + Block("1916:l000002e4", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1940:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1940:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1464:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1480bv64) + ), + jumps( + DirectCall("1716:call_weak_fn", condition()) + ) + ) + Block("1480:l0000053d", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1712bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1712:l0000020e", + statements( + LocalAssign(Register(R30, bv64) := 1716bv64) + ), + jumps( + DirectCall("1584:abort", condition()) + ) + ) + Block("?:l000005f3", + statements( + ), + jumps( + DirectCall("1716:call_weak_fn", condition()) + ) + ) +)), +Procedure("1584:abort", in(), out(), blocks( +)), +Procedure("1716:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1716:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1732:l00000224", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1728:l00000384", condition()) + ) + ) + Block("1732:l00000224", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1728:l00000384", + statements( + ), + jumps( + GoTo("1568:l__gmon_start__", condition()) + ) + ) + Block("1568:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1744:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1744:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1788:l00000269", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1768:l00000366", condition()) + ) + ) + Block("1768:l00000366", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1788:l00000269", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1780:l00000379", condition()) + ) + ) + Block("1788:l00000269", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1780:l00000379", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1600:fork", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1936:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1936:lframe_dummy", + statements( + ), + jumps( + DirectCall("1792:register_tm_clones", condition()) + ) + ) +)), +Procedure("1792:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1848:l000002a5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000348", condition()) + ) + ) + Block("1828:l00000348", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1848:l000002a5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1840:l0000035b", condition()) + ) + ) + Block("1848:l000002a5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1840:l0000035b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/syscall/gcc_no_plt_no_pic/syscall-before-analysis.il.expected b/src/test/correct/syscall/gcc_no_plt_no_pic/syscall-before-analysis.il.expected new file mode 100644 index 000000000..ee7bc2d9b --- /dev/null +++ b/src/test/correct/syscall/gcc_no_plt_no_pic/syscall-before-analysis.il.expected @@ -0,0 +1,323 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l0000089c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000091d", condition()) + ) + ) + Block("1816:l0000091d", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000092b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000944", condition()) + ) + ) + Block("1828:l00000944", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000092b", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000937", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l0000089c", condition()) + ) + ) + Block("1852:l0000089c", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1912:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1912:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1464:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1480bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1480:l00000b46", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000007c6", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1584:abort", condition()) + ) + ) + Block("?:l00000bd5", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1584:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l000007dc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000994", condition()) + ) + ) + Block("1668:l000007dc", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000994", + statements( + ), + jumps( + GoTo("1568:l__gmon_start__", condition()) + ) + ) + Block("1568:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000821", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000976", condition()) + ) + ) + Block("1704:l00000976", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000821", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000989", condition()) + ) + ) + Block("1724:l00000821", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000989", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1552:fork", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) + LocalAssign(Register(R30, bv64) := 1896bv64) + ), + jumps( + DirectCall("1552:fork", condition()) + ) + ) + Block("1896:l000008f9", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 44bv64)]), 32)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000958", condition()) + ) + ) + Block("1764:l00000958", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000096b", condition()) + ) + ) + Block("1784:l0000085d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000096b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/syscall/gcc_pic/syscall-before-analysis.il.expected b/src/test/correct/syscall/gcc_pic/syscall-before-analysis.il.expected new file mode 100644 index 000000000..ee7bc2d9b --- /dev/null +++ b/src/test/correct/syscall/gcc_pic/syscall-before-analysis.il.expected @@ -0,0 +1,323 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l0000089c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000091d", condition()) + ) + ) + Block("1816:l0000091d", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000092b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000944", condition()) + ) + ) + Block("1828:l00000944", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000092b", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000937", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l0000089c", condition()) + ) + ) + Block("1852:l0000089c", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1912:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1912:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1464:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1480bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1480:l00000b46", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000007c6", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1584:abort", condition()) + ) + ) + Block("?:l00000bd5", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1584:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l000007dc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000994", condition()) + ) + ) + Block("1668:l000007dc", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000994", + statements( + ), + jumps( + GoTo("1568:l__gmon_start__", condition()) + ) + ) + Block("1568:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000821", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000976", condition()) + ) + ) + Block("1704:l00000976", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000821", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000989", condition()) + ) + ) + Block("1724:l00000821", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000989", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1552:fork", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) + LocalAssign(Register(R30, bv64) := 1896bv64) + ), + jumps( + DirectCall("1552:fork", condition()) + ) + ) + Block("1896:l000008f9", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 44bv64)]), 32)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000958", condition()) + ) + ) + Block("1764:l00000958", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000096b", condition()) + ) + ) + Block("1784:l0000085d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000096b", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/using_gamma_conditional/clang/using_gamma_conditional-before-analysis.il.expected b/src/test/correct/using_gamma_conditional/clang/using_gamma_conditional-before-analysis.il.expected new file mode 100644 index 000000000..d315cf902 --- /dev/null +++ b/src/test/correct/using_gamma_conditional/clang/using_gamma_conditional-before-analysis.il.expected @@ -0,0 +1,369 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002c1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000367", condition()) + ) + ) + Block("1752:l00000367", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000375", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000038e", condition()) + ) + ) + Block("1764:l0000038e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000375", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000381", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002c1", condition()) + ) + ) + Block("1788:l000002c1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000571", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001eb", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000626", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000201", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003de", condition()) + ) + ) + Block("1604:l00000201", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003de", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003c0", condition()) + ) + ) + Block("1640:l000003c0", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003d3", condition()) + ) + ) + Block("1660:l00000246", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003d3", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000322", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("?:l00000325", condition()) + ) + ) + Block("?:l00000325", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000328", condition()) + ) + ) + Block("?:l00000322", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000328", condition()) + ) + ) + Block("?:l00000328", + statements( + ), + jumps( + GoTo("1852:l00000330", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1840:l00000358", condition()) + ) + ) + Block("1852:l00000330", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1864:l00000343", condition()) + ) + ) + Block("1840:l00000358", + statements( + ), + jumps( + GoTo("1844:l00000359", condition()) + ) + ) + Block("1844:l00000359", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + ), + jumps( + GoTo("1864:l00000343", condition()) + ) + ) + Block("1864:l00000343", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003a2", condition()) + ) + ) + Block("1700:l000003a2", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003b5", condition()) + ) + ) + Block("1720:l00000282", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003b5", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/using_gamma_conditional/clang_O2/using_gamma_conditional-before-analysis.il.expected b/src/test/correct/using_gamma_conditional/clang_O2/using_gamma_conditional-before-analysis.il.expected new file mode 100644 index 000000000..dcaa079e2 --- /dev/null +++ b/src/test/correct/using_gamma_conditional/clang_O2/using_gamma_conditional-before-analysis.il.expected @@ -0,0 +1,332 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002f6", condition()) + ) + ) + Block("1752:l000002f6", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000304", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000031d", condition()) + ) + ) + Block("1764:l0000031d", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000304", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000310", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000295", condition()) + ) + ) + Block("1788:l00000295", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1832:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004f5", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001bf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000059e", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000036d", condition()) + ) + ) + Block("1604:l000001d5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000036d", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000034f", condition()) + ) + ) + Block("1640:l0000034f", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000362", condition()) + ) + ) + Block("1660:l0000021a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000362", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("?:l000002e5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("?:l000002e8", condition()) + ) + ) + Block("?:l000002e8", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + ), + jumps( + GoTo("?:l000002eb", condition()) + ) + ) + Block("?:l000002e5", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + GoTo("?:l000002eb", condition()) + ) + ) + Block("?:l000002eb", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000331", condition()) + ) + ) + Block("1700:l00000331", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000344", condition()) + ) + ) + Block("1720:l00000256", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000344", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/using_gamma_conditional/clang_no_plt_no_pic/using_gamma_conditional-before-analysis.il.expected b/src/test/correct/using_gamma_conditional/clang_no_plt_no_pic/using_gamma_conditional-before-analysis.il.expected new file mode 100644 index 000000000..aa395bb43 --- /dev/null +++ b/src/test/correct/using_gamma_conditional/clang_no_plt_no_pic/using_gamma_conditional-before-analysis.il.expected @@ -0,0 +1,369 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008dc", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000982", condition()) + ) + ) + Block("1752:l00000982", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000990", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009a9", condition()) + ) + ) + Block("1764:l000009a9", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000990", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000099c", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008dc", condition()) + ) + ) + Block("1788:l000008dc", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b8c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000806", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c1e", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000081c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000009f9", condition()) + ) + ) + Block("1604:l0000081c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000009f9", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000861", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009db", condition()) + ) + ) + Block("1640:l000009db", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000861", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009ee", condition()) + ) + ) + Block("1660:l00000861", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009ee", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l0000093d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("?:l00000940", condition()) + ) + ) + Block("?:l00000940", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000943", condition()) + ) + ) + Block("?:l0000093d", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000943", condition()) + ) + ) + Block("?:l00000943", + statements( + ), + jumps( + GoTo("1852:l0000094b", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1840:l00000973", condition()) + ) + ) + Block("1852:l0000094b", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1864:l0000095e", condition()) + ) + ) + Block("1840:l00000973", + statements( + ), + jumps( + GoTo("1844:l00000974", condition()) + ) + ) + Block("1844:l00000974", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + ), + jumps( + GoTo("1864:l0000095e", condition()) + ) + ) + Block("1864:l0000095e", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000089d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009bd", condition()) + ) + ) + Block("1700:l000009bd", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000089d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009d0", condition()) + ) + ) + Block("1720:l0000089d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009d0", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/using_gamma_conditional/clang_pic/using_gamma_conditional-before-analysis.il.expected b/src/test/correct/using_gamma_conditional/clang_pic/using_gamma_conditional-before-analysis.il.expected new file mode 100644 index 000000000..55fcc00a4 --- /dev/null +++ b/src/test/correct/using_gamma_conditional/clang_pic/using_gamma_conditional-before-analysis.il.expected @@ -0,0 +1,370 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000372", condition()) + ) + ) + Block("1816:l00000372", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) + ), + jumps( + GoTo("1840:l00000380", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000399", condition()) + ) + ) + Block("1828:l00000399", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000380", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000038c", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002c5", condition()) + ) + ) + Block("1852:l000002c5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1944:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l00000520", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001ef", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l000005d6", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003e9", condition()) + ) + ) + Block("1668:l00000205", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003e9", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003cb", condition()) + ) + ) + Block("1704:l000003cb", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003de", condition()) + ) + ) + Block("1724:l0000024a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003de", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4040bv64)])) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l0000032d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("?:l00000330", condition()) + ) + ) + Block("?:l00000330", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000333", condition()) + ) + ) + Block("?:l0000032d", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000333", condition()) + ) + ) + Block("?:l00000333", + statements( + ), + jumps( + GoTo("1920:l0000033b", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1908:l00000363", condition()) + ) + ) + Block("1920:l0000033b", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1932:l0000034e", condition()) + ) + ) + Block("1908:l00000363", + statements( + ), + jumps( + GoTo("1912:l00000364", condition()) + ) + ) + Block("1912:l00000364", + statements( + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + ), + jumps( + GoTo("1932:l0000034e", condition()) + ) + ) + Block("1932:l0000034e", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003ad", condition()) + ) + ) + Block("1764:l000003ad", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003c0", condition()) + ) + ) + Block("1784:l00000286", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003c0", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/using_gamma_conditional/gcc/using_gamma_conditional-before-analysis.il.expected b/src/test/correct/using_gamma_conditional/gcc/using_gamma_conditional-before-analysis.il.expected new file mode 100644 index 000000000..321ef1837 --- /dev/null +++ b/src/test/correct/using_gamma_conditional/gcc/using_gamma_conditional-before-analysis.il.expected @@ -0,0 +1,333 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000312", condition()) + ) + ) + Block("1752:l00000312", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000320", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000339", condition()) + ) + ) + Block("1764:l00000339", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000320", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000032c", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002a5", condition()) + ) + ) + Block("1788:l000002a5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1848:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000515", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001cf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005c4", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000389", condition()) + ) + ) + Block("1604:l000001e5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000389", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000036b", condition()) + ) + ) + Block("1640:l0000036b", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000037e", condition()) + ) + ) + Block("1660:l0000022a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000037e", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1840:l000002fa", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1832:l00000309", condition()) + ) + ) + Block("1840:l000002fa", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + ), + jumps( + GoTo("1844:l00000304", condition()) + ) + ) + Block("1832:l00000309", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + GoTo("1844:l00000304", condition()) + ) + ) + Block("1844:l00000304", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000034d", condition()) + ) + ) + Block("1700:l0000034d", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000360", condition()) + ) + ) + Block("1720:l00000266", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000360", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/using_gamma_conditional/gcc_O2/using_gamma_conditional-before-analysis.il.expected b/src/test/correct/using_gamma_conditional/gcc_O2/using_gamma_conditional-before-analysis.il.expected new file mode 100644 index 000000000..05a442bf5 --- /dev/null +++ b/src/test/correct/using_gamma_conditional/gcc_O2/using_gamma_conditional-before-analysis.il.expected @@ -0,0 +1,332 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l0000030f", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000338", condition()) + ) + ) + Block("1816:l00000338", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l00000346", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000035f", condition()) + ) + ) + Block("1828:l0000035f", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000346", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000352", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l0000030f", condition()) + ) + ) + Block("1852:l0000030f", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l00000542", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000239", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005f6", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l0000024f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003af", condition()) + ) + ) + Block("1668:l0000024f", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003af", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000294", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000391", condition()) + ) + ) + Block("1704:l00000391", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000294", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003a4", condition()) + ) + ) + Block("1724:l00000294", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003a4", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 20bv64)]), 32)) + LocalAssign(LocalVar(#1, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#1, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#1, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#1, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#1, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("?:l000001cf", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("?:l000001d2", condition()) + ) + ) + Block("?:l000001d2", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + ), + jumps( + GoTo("?:l000001d5", condition()) + ) + ) + Block("?:l000001cf", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + GoTo("?:l000001d5", condition()) + ) + ) + Block("?:l000001d5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002d0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000373", condition()) + ) + ) + Block("1764:l00000373", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002d0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000386", condition()) + ) + ) + Block("1784:l000002d0", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000386", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/using_gamma_conditional/gcc_no_plt_no_pic/using_gamma_conditional-before-analysis.il.expected b/src/test/correct/using_gamma_conditional/gcc_no_plt_no_pic/using_gamma_conditional-before-analysis.il.expected new file mode 100644 index 000000000..c9886d0e2 --- /dev/null +++ b/src/test/correct/using_gamma_conditional/gcc_no_plt_no_pic/using_gamma_conditional-before-analysis.il.expected @@ -0,0 +1,333 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000085e", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000008cb", condition()) + ) + ) + Block("1752:l000008cb", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000008d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000008f2", condition()) + ) + ) + Block("1764:l000008f2", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000008d9", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000008e5", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000085e", condition()) + ) + ) + Block("1788:l0000085e", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1848:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000ace", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000788", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000b59", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l0000079e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000942", condition()) + ) + ) + Block("1604:l0000079e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000942", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000007e3", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000924", condition()) + ) + ) + Block("1640:l00000924", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l000007e3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000937", condition()) + ) + ) + Block("1660:l000007e3", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000937", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1840:l000008b3", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1832:l000008c2", condition()) + ) + ) + Block("1840:l000008b3", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + ), + jumps( + GoTo("1844:l000008bd", condition()) + ) + ) + Block("1832:l000008c2", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + GoTo("1844:l000008bd", condition()) + ) + ) + Block("1844:l000008bd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000081f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000906", condition()) + ) + ) + Block("1700:l00000906", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000081f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000919", condition()) + ) + ) + Block("1720:l0000081f", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000919", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/using_gamma_conditional/gcc_pic/using_gamma_conditional-before-analysis.il.expected b/src/test/correct/using_gamma_conditional/gcc_pic/using_gamma_conditional-before-analysis.il.expected new file mode 100644 index 000000000..c8a64ef97 --- /dev/null +++ b/src/test/correct/using_gamma_conditional/gcc_pic/using_gamma_conditional-before-analysis.il.expected @@ -0,0 +1,333 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000313", condition()) + ) + ) + Block("1816:l00000313", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + ), + jumps( + GoTo("1840:l00000321", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000033a", condition()) + ) + ) + Block("1828:l0000033a", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000321", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000032d", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002a5", condition()) + ) + ) + Block("1852:l000002a5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1912:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1912:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l000004c1", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001cf", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l00000570", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000038a", condition()) + ) + ) + Block("1668:l000001e5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000038a", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000036c", condition()) + ) + ) + Block("1704:l0000036c", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) + ), + jumps( + GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l0000037f", condition()) + ) + ) + Block("1724:l0000022a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l0000037f", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1904:l000002fb", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1896:l0000030a", condition()) + ) + ) + Block("1904:l000002fb", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + ), + jumps( + GoTo("1908:l00000305", condition()) + ) + ) + Block("1896:l0000030a", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + GoTo("1908:l00000305", condition()) + ) + ) + Block("1908:l00000305", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000034e", condition()) + ) + ) + Block("1764:l0000034e", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000361", condition()) + ) + ) + Block("1784:l00000266", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000361", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/using_gamma_write_z/clang/using_gamma_write_z-before-analysis.il.expected b/src/test/correct/using_gamma_write_z/clang/using_gamma_write_z-before-analysis.il.expected new file mode 100644 index 000000000..8a23eadb8 --- /dev/null +++ b/src/test/correct/using_gamma_write_z/clang/using_gamma_write_z-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002da", condition()) + ) + ) + Block("1752:l000002da", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000301", condition()) + ) + ) + Block("1764:l00000301", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002e8", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002f4", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000295", condition()) + ) + ) + Block("1788:l00000295", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1832:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004d9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001bf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000582", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000351", condition()) + ) + ) + Block("1604:l000001d5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000351", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000333", condition()) + ) + ) + Block("1640:l00000333", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000346", condition()) + ) + ) + Block("1660:l0000021a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000346", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000315", condition()) + ) + ) + Block("1700:l00000315", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000328", condition()) + ) + ) + Block("1720:l00000256", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000328", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/using_gamma_write_z/clang_O2/using_gamma_write_z-before-analysis.il.expected b/src/test/correct/using_gamma_write_z/clang_O2/using_gamma_write_z-before-analysis.il.expected new file mode 100644 index 000000000..e47151e8a --- /dev/null +++ b/src/test/correct/using_gamma_write_z/clang_O2/using_gamma_write_z-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002da", condition()) + ) + ) + Block("1752:l000002da", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000301", condition()) + ) + ) + Block("1764:l00000301", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002e8", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002f4", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000295", condition()) + ) + ) + Block("1788:l00000295", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1832:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004d9", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001bf", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000582", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000351", condition()) + ) + ) + Block("1604:l000001d5", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000351", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000333", condition()) + ) + ) + Block("1640:l00000333", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000346", condition()) + ) + ) + Block("1660:l0000021a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000346", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 1bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000315", condition()) + ) + ) + Block("1700:l00000315", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000328", condition()) + ) + ) + Block("1720:l00000256", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000328", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/using_gamma_write_z/clang_no_plt_no_pic/using_gamma_write_z-before-analysis.il.expected b/src/test/correct/using_gamma_write_z/clang_no_plt_no_pic/using_gamma_write_z-before-analysis.il.expected new file mode 100644 index 000000000..37424e6b7 --- /dev/null +++ b/src/test/correct/using_gamma_write_z/clang_no_plt_no_pic/using_gamma_write_z-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000080c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000851", condition()) + ) + ) + Block("1752:l00000851", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000085f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000878", condition()) + ) + ) + Block("1764:l00000878", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000085f", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000086b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000080c", condition()) + ) + ) + Block("1788:l0000080c", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1832:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000a50", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000736", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000ad7", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l0000074c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000008c8", condition()) + ) + ) + Block("1604:l0000074c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000008c8", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000008aa", condition()) + ) + ) + Block("1640:l000008aa", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000008bd", condition()) + ) + ) + Block("1660:l00000791", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000008bd", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000088c", condition()) + ) + ) + Block("1700:l0000088c", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000089f", condition()) + ) + ) + Block("1720:l000007cd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000089f", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/using_gamma_write_z/clang_pic/using_gamma_write_z-before-analysis.il.expected b/src/test/correct/using_gamma_write_z/clang_pic/using_gamma_write_z-before-analysis.il.expected new file mode 100644 index 000000000..bba5c8aee --- /dev/null +++ b/src/test/correct/using_gamma_write_z/clang_pic/using_gamma_write_z-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000002e5", condition()) + ) + ) + Block("1816:l000002e5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) + ), + jumps( + GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000030c", condition()) + ) + ) + Block("1828:l0000030c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l000002f3", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000002ff", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l00000299", condition()) + ) + ) + Block("1852:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1900:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l00000493", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l0000053d", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000035c", condition()) + ) + ) + Block("1668:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000035c", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000033e", condition()) + ) + ) + Block("1704:l0000033e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000351", condition()) + ) + ) + Block("1724:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000351", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4040bv64)])) + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000320", condition()) + ) + ) + Block("1764:l00000320", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000333", condition()) + ) + ) + Block("1784:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000333", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/using_gamma_write_z/gcc/using_gamma_write_z-before-analysis.il.expected b/src/test/correct/using_gamma_write_z/gcc/using_gamma_write_z-before-analysis.il.expected new file mode 100644 index 000000000..28b23d5f7 --- /dev/null +++ b/src/test/correct/using_gamma_write_z/gcc/using_gamma_write_z-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002e4", condition()) + ) + ) + Block("1752:l000002e4", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000002f2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000030b", condition()) + ) + ) + Block("1764:l0000030b", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002f2", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002fe", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000299", condition()) + ) + ) + Block("1788:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004e4", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000058e", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000035b", condition()) + ) + ) + Block("1604:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000035b", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000033d", condition()) + ) + ) + Block("1640:l0000033d", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000350", condition()) + ) + ) + Block("1660:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000350", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000031f", condition()) + ) + ) + Block("1700:l0000031f", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000332", condition()) + ) + ) + Block("1720:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000332", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/using_gamma_write_z/gcc_O2/using_gamma_write_z-before-analysis.il.expected b/src/test/correct/using_gamma_write_z/gcc_O2/using_gamma_write_z-before-analysis.il.expected new file mode 100644 index 000000000..bebedbe2b --- /dev/null +++ b/src/test/correct/using_gamma_write_z/gcc_O2/using_gamma_write_z-before-analysis.il.expected @@ -0,0 +1,305 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f3", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000031c", condition()) + ) + ) + Block("1816:l0000031c", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000032a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000343", condition()) + ) + ) + Block("1828:l00000343", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000032a", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000336", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f3", condition()) + ) + ) + Block("1852:l000002f3", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l00000526", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l0000021d", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005da", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000233", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000393", condition()) + ) + ) + Block("1668:l00000233", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000393", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000375", condition()) + ) + ) + Block("1704:l00000375", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000388", condition()) + ) + ) + Block("1724:l00000278", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000388", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R2, bv64) := 1bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R2, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000357", condition()) + ) + ) + Block("1764:l00000357", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000036a", condition()) + ) + ) + Block("1784:l000002b4", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000036a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/using_gamma_write_z/gcc_no_plt_no_pic/using_gamma_write_z-before-analysis.il.expected b/src/test/correct/using_gamma_write_z/gcc_no_plt_no_pic/using_gamma_write_z-before-analysis.il.expected new file mode 100644 index 000000000..d319879d6 --- /dev/null +++ b/src/test/correct/using_gamma_write_z/gcc_no_plt_no_pic/using_gamma_write_z-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l0000081c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000867", condition()) + ) + ) + Block("1752:l00000867", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000088e", condition()) + ) + ) + Block("1764:l0000088e", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000875", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000881", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l0000081c", condition()) + ) + ) + Block("1788:l0000081c", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000a67", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000746", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000aef", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l0000075c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000008de", condition()) + ) + ) + Block("1604:l0000075c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000008de", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000008c0", condition()) + ) + ) + Block("1640:l000008c0", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000008d3", condition()) + ) + ) + Block("1660:l000007a1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000008d3", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000008a2", condition()) + ) + ) + Block("1700:l000008a2", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000008b5", condition()) + ) + ) + Block("1720:l000007dd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000008b5", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/correct/using_gamma_write_z/gcc_pic/using_gamma_write_z-before-analysis.il.expected b/src/test/correct/using_gamma_write_z/gcc_pic/using_gamma_write_z-before-analysis.il.expected new file mode 100644 index 000000000..da93bfeeb --- /dev/null +++ b/src/test/correct/using_gamma_write_z/gcc_pic/using_gamma_write_z-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000002e5", condition()) + ) + ) + Block("1816:l000002e5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + ), + jumps( + GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000030c", condition()) + ) + ) + Block("1828:l0000030c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1504:__cxa_finalize", condition()) + ) + ) + Block("1840:l000002f3", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000002ff", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l00000299", condition()) + ) + ) + Block("1852:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1488:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1900:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1432:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1448bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1448:l00000493", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1488:__libc_start_main", condition()) + ) + ) + Block("1648:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1536:abort", condition()) + ) + ) + Block("?:l0000053d", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1536:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000035c", condition()) + ) + ) + Block("1668:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000035c", + statements( + ), + jumps( + GoTo("1520:l__gmon_start__", condition()) + ) + ) + Block("1520:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000033e", condition()) + ) + ) + Block("1704:l0000033e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) + ), + jumps( + GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000351", condition()) + ) + ) + Block("1724:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000351", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R1, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000320", condition()) + ) + ) + Block("1764:l00000320", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000333", condition()) + ) + ) + Block("1784:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000333", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign/clang/basicassign-before-analysis.il.expected b/src/test/incorrect/basicassign/clang/basicassign-before-analysis.il.expected new file mode 100644 index 000000000..27524afe5 --- /dev/null +++ b/src/test/incorrect/basicassign/clang/basicassign-before-analysis.il.expected @@ -0,0 +1,314 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002b9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000033e", condition()) + ) + ) + Block("1752:l0000033e", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000034c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000365", condition()) + ) + ) + Block("1764:l00000365", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000034c", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000358", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002b9", condition()) + ) + ) + Block("1788:l000002b9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1868:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1868:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000546", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001e3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005d6", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001f9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003b5", condition()) + ) + ) + Block("1604:l000001f9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003b5", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000397", condition()) + ) + ) + Block("1640:l00000397", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003aa", condition()) + ) + ) + Block("1660:l0000023e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003aa", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R10, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R10, bv64), 52bv64)]), 32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := Extract(Register(R9, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) + LocalAssign(Register(R11, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) + LocalAssign(Register(R9, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 60bv64)] := Extract(Register(R11, bv64)[32:0]))) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R10, bv64), 52bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := Extract(Register(R10, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 60bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000379", condition()) + ) + ) + Block("1700:l00000379", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000038c", condition()) + ) + ) + Block("1720:l0000027a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000038c", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign/clang_O2/basicassign-before-analysis.il.expected b/src/test/incorrect/basicassign/clang_O2/basicassign-before-analysis.il.expected new file mode 100644 index 000000000..cadb95178 --- /dev/null +++ b/src/test/incorrect/basicassign/clang_O2/basicassign-before-analysis.il.expected @@ -0,0 +1,308 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002a1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002fa", condition()) + ) + ) + Block("1752:l000002fa", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000308", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000321", condition()) + ) + ) + Block("1764:l00000321", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000308", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000314", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002a1", condition()) + ) + ) + Block("1788:l000002a1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1844:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1844:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004fc", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001cb", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000586", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001e1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000371", condition()) + ) + ) + Block("1604:l000001e1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000371", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000353", condition()) + ) + ) + Block("1640:l00000353", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000366", condition()) + ) + ) + Block("1660:l00000226", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000366", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R10, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R10, bv64), 60bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000335", condition()) + ) + ) + Block("1700:l00000335", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000348", condition()) + ) + ) + Block("1720:l00000262", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000348", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign/clang_no_plt_no_pic/basicassign-before-analysis.il.expected b/src/test/incorrect/basicassign/clang_no_plt_no_pic/basicassign-before-analysis.il.expected new file mode 100644 index 000000000..fadb39eff --- /dev/null +++ b/src/test/incorrect/basicassign/clang_no_plt_no_pic/basicassign-before-analysis.il.expected @@ -0,0 +1,314 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008a6", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000092b", condition()) + ) + ) + Block("1752:l0000092b", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000939", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000952", condition()) + ) + ) + Block("1764:l00000952", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000939", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000945", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008a6", condition()) + ) + ) + Block("1788:l000008a6", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1868:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1868:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b33", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007d0", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000bc3", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000007e6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000009a2", condition()) + ) + ) + Block("1604:l000007e6", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000009a2", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000082b", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000984", condition()) + ) + ) + Block("1640:l00000984", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000082b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000997", condition()) + ) + ) + Block("1660:l0000082b", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000997", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R10, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R10, bv64), 52bv64)]), 32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := Extract(Register(R9, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) + LocalAssign(Register(R11, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) + LocalAssign(Register(R9, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 60bv64)] := Extract(Register(R11, bv64)[32:0]))) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R10, bv64), 52bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := Extract(Register(R10, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 60bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000867", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000966", condition()) + ) + ) + Block("1700:l00000966", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000867", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000979", condition()) + ) + ) + Block("1720:l00000867", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000979", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign/clang_pic/basicassign-before-analysis.il.expected b/src/test/incorrect/basicassign/clang_pic/basicassign-before-analysis.il.expected new file mode 100644 index 000000000..05540e258 --- /dev/null +++ b/src/test/incorrect/basicassign/clang_pic/basicassign-before-analysis.il.expected @@ -0,0 +1,317 @@ +Procedure("1552:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000035f", condition()) + ) + ) + Block("1816:l0000035f", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4016bv64)])) + ), + jumps( + GoTo("1840:l0000036d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000386", condition()) + ) + ) + Block("1828:l00000386", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1552:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000036d", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000379", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002c5", condition()) + ) + ) + Block("1852:l000002c5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1944:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1480:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1480:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1496bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1496:l0000056a", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1536:__libc_start_main", condition()) + ) + ) + Block("1648:l000001ef", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1584:abort", condition()) + ) + ) + Block("?:l0000061f", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1584:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003d6", condition()) + ) + ) + Block("1668:l00000205", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003d6", + statements( + ), + jumps( + GoTo("1568:l__gmon_start__", condition()) + ) + ) + Block("1568:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003b8", condition()) + ) + ) + Block("1704:l000003b8", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4008bv64)])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003cb", condition()) + ) + ) + Block("1724:l0000024a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003cb", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) + LocalAssign(Register(R10, bv64) := 65536bv64) + LocalAssign(Register(R10, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R10, bv64), 4048bv64)])) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R10, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R9, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := 0bv32)) + LocalAssign(Register(R11, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4024bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R11, bv64)[32:0]))) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R10, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R10, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000039a", condition()) + ) + ) + Block("1764:l0000039a", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003ad", condition()) + ) + ) + Block("1784:l00000286", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003ad", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign/gcc/basicassign-before-analysis.il.expected b/src/test/incorrect/basicassign/gcc/basicassign-before-analysis.il.expected new file mode 100644 index 000000000..81fad0754 --- /dev/null +++ b/src/test/incorrect/basicassign/gcc/basicassign-before-analysis.il.expected @@ -0,0 +1,329 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002f5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000003ce", condition()) + ) + ) + Block("1752:l000003ce", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000003dc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003f5", condition()) + ) + ) + Block("1764:l000003f5", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000003dc", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000003e8", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002f5", condition()) + ) + ) + Block("1788:l000002f5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1928:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1928:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000005e5", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000021f", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000684", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000235", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000445", condition()) + ) + ) + Block("1604:l00000235", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000445", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000427", condition()) + ) + ) + Block("1640:l00000427", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000043a", condition()) + ) + ) + Block("1660:l0000027a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000043a", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 28bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 28bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000002b6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000409", condition()) + ) + ) + Block("1700:l00000409", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000002b6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000041c", condition()) + ) + ) + Block("1720:l000002b6", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000041c", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign/gcc_O2/basicassign-before-analysis.il.expected b/src/test/incorrect/basicassign/gcc_O2/basicassign-before-analysis.il.expected new file mode 100644 index 000000000..0e11b8b11 --- /dev/null +++ b/src/test/incorrect/basicassign/gcc_O2/basicassign-before-analysis.il.expected @@ -0,0 +1,308 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l00000303", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000032c", condition()) + ) + ) + Block("1816:l0000032c", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l0000033a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000353", condition()) + ) + ) + Block("1828:l00000353", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000033a", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000346", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l00000303", condition()) + ) + ) + Block("1852:l00000303", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l00000536", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l0000022d", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005c8", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000243", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003a3", condition()) + ) + ) + Block("1668:l00000243", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003a3", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000288", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000385", condition()) + ) + ) + Block("1704:l00000385", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l00000288", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000398", condition()) + ) + ) + Block("1724:l00000288", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000398", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R2, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R2, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 20bv64)]), 32)) + LocalAssign(LocalVar(#1, bv64) := BinaryExpr("add", Register(R1, bv64), 4bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#1, bv64)] := Extract(Register(R2, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#1, bv64), 4bv64)] := Extract(Register(R2, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002c4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000367", condition()) + ) + ) + Block("1764:l00000367", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002c4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l0000037a", condition()) + ) + ) + Block("1784:l000002c4", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l0000037a", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign/gcc_no_plt_no_pic/basicassign-before-analysis.il.expected b/src/test/incorrect/basicassign/gcc_no_plt_no_pic/basicassign-before-analysis.il.expected new file mode 100644 index 000000000..3e36ba495 --- /dev/null +++ b/src/test/incorrect/basicassign/gcc_no_plt_no_pic/basicassign-before-analysis.il.expected @@ -0,0 +1,329 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000990", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000a69", condition()) + ) + ) + Block("1752:l00000a69", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000a77", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000a90", condition()) + ) + ) + Block("1764:l00000a90", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000a77", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000a83", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000990", condition()) + ) + ) + Block("1788:l00000990", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1928:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1928:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000c80", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000008ba", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000d1f", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000008d0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000ae0", condition()) + ) + ) + Block("1604:l000008d0", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000ae0", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000915", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000ac2", condition()) + ) + ) + Block("1640:l00000ac2", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000915", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000ad5", condition()) + ) + ) + Block("1660:l00000915", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000ad5", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 28bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 28bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000951", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000aa4", condition()) + ) + ) + Block("1700:l00000aa4", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000951", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000ab7", condition()) + ) + ) + Block("1720:l00000951", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000ab7", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign/gcc_pic/basicassign-before-analysis.il.expected b/src/test/incorrect/basicassign/gcc_pic/basicassign-before-analysis.il.expected new file mode 100644 index 000000000..bcee17e63 --- /dev/null +++ b/src/test/incorrect/basicassign/gcc_pic/basicassign-before-analysis.il.expected @@ -0,0 +1,329 @@ +Procedure("1552:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l000003d7", condition()) + ) + ) + Block("1816:l000003d7", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1840:l000003e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l000003fe", condition()) + ) + ) + Block("1828:l000003fe", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1552:__cxa_finalize", condition()) + ) + ) + Block("1840:l000003e5", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000003f1", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f5", condition()) + ) + ) + Block("1852:l000002f5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1992:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1992:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1480:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1480:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1496bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1496:l000005ee", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1536:__libc_start_main", condition()) + ) + ) + Block("1648:l0000021f", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1584:abort", condition()) + ) + ) + Block("?:l000006af", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1584:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1668:l00000235", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000044e", condition()) + ) + ) + Block("1668:l00000235", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000044e", + statements( + ), + jumps( + GoTo("1568:l__gmon_start__", condition()) + ) + ) + Block("1568:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l00000430", condition()) + ) + ) + Block("1704:l00000430", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1724:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000443", condition()) + ) + ) + Block("1724:l0000027a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000443", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002b6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000412", condition()) + ) + ) + Block("1764:l00000412", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002b6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000425", condition()) + ) + ) + Block("1784:l000002b6", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000425", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign1/clang/basicassign1-before-analysis.il.expected b/src/test/incorrect/basicassign1/clang/basicassign1-before-analysis.il.expected new file mode 100644 index 000000000..7a0c2aa40 --- /dev/null +++ b/src/test/incorrect/basicassign1/clang/basicassign1-before-analysis.il.expected @@ -0,0 +1,315 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000349", condition()) + ) + ) + Block("1752:l00000349", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000357", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000370", condition()) + ) + ) + Block("1764:l00000370", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000357", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000363", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002bd", condition()) + ) + ) + Block("1788:l000002bd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000552", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001e7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005e3", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003c0", condition()) + ) + ) + Block("1604:l000001fd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003c0", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003a2", condition()) + ) + ) + Block("1640:l000003a2", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003b5", condition()) + ) + ) + Block("1660:l00000242", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003b5", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R9, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R9, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R10, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000384", condition()) + ) + ) + Block("1700:l00000384", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000397", condition()) + ) + ) + Block("1720:l0000027e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000397", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign1/clang_O2/basicassign1-before-analysis.il.expected b/src/test/incorrect/basicassign1/clang_O2/basicassign1-before-analysis.il.expected new file mode 100644 index 000000000..09a3b4428 --- /dev/null +++ b/src/test/incorrect/basicassign1/clang_O2/basicassign1-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002e5", condition()) + ) + ) + Block("1752:l000002e5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000030c", condition()) + ) + ) + Block("1764:l0000030c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002f3", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002ff", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000299", condition()) + ) + ) + Block("1788:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004e5", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000056d", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000035c", condition()) + ) + ) + Block("1604:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000035c", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000033e", condition()) + ) + ) + Block("1640:l0000033e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000351", condition()) + ) + ) + Block("1660:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000351", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000320", condition()) + ) + ) + Block("1700:l00000320", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000333", condition()) + ) + ) + Block("1720:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000333", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign1/clang_no_plt_no_pic/basicassign1-before-analysis.il.expected b/src/test/incorrect/basicassign1/clang_no_plt_no_pic/basicassign1-before-analysis.il.expected new file mode 100644 index 000000000..e26062499 --- /dev/null +++ b/src/test/incorrect/basicassign1/clang_no_plt_no_pic/basicassign1-before-analysis.il.expected @@ -0,0 +1,315 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008b7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000943", condition()) + ) + ) + Block("1752:l00000943", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000951", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000096a", condition()) + ) + ) + Block("1764:l0000096a", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000951", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000095d", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008b7", condition()) + ) + ) + Block("1788:l000008b7", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b4c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007e1", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000bdd", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000007f7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000009ba", condition()) + ) + ) + Block("1604:l000007f7", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000009ba", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000083c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000099c", condition()) + ) + ) + Block("1640:l0000099c", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000083c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009af", condition()) + ) + ) + Block("1660:l0000083c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009af", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R9, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R9, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R10, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000878", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000097e", condition()) + ) + ) + Block("1700:l0000097e", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000878", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000991", condition()) + ) + ) + Block("1720:l00000878", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000991", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign1/clang_pic/basicassign1-before-analysis.il.expected b/src/test/incorrect/basicassign1/clang_pic/basicassign1-before-analysis.il.expected new file mode 100644 index 000000000..d098569de --- /dev/null +++ b/src/test/incorrect/basicassign1/clang_pic/basicassign1-before-analysis.il.expected @@ -0,0 +1,317 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000035f", condition()) + ) + ) + Block("1816:l0000035f", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) + ), + jumps( + GoTo("1840:l0000036d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000386", condition()) + ) + ) + Block("1828:l00000386", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000036d", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000379", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002c5", condition()) + ) + ) + Block("1852:l000002c5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1944:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l0000050d", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001ef", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l000005a9", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003d6", condition()) + ) + ) + Block("1668:l00000205", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003d6", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003b8", condition()) + ) + ) + Block("1704:l000003b8", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003cb", condition()) + ) + ) + Block("1724:l0000024a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003cb", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4048bv64)])) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R9, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4032bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R10, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000039a", condition()) + ) + ) + Block("1764:l0000039a", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003ad", condition()) + ) + ) + Block("1784:l00000286", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003ad", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign1/gcc/basicassign1-before-analysis.il.expected b/src/test/incorrect/basicassign1/gcc/basicassign1-before-analysis.il.expected new file mode 100644 index 000000000..25b31daaf --- /dev/null +++ b/src/test/incorrect/basicassign1/gcc/basicassign1-before-analysis.il.expected @@ -0,0 +1,321 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000383", condition()) + ) + ) + Block("1752:l00000383", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000391", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003aa", condition()) + ) + ) + Block("1764:l000003aa", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000391", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000039d", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002d5", condition()) + ) + ) + Block("1788:l000002d5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1896:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000592", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001ff", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000629", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003fa", condition()) + ) + ) + Block("1604:l00000215", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003fa", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003dc", condition()) + ) + ) + Block("1640:l000003dc", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003ef", condition()) + ) + ) + Block("1660:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003ef", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003be", condition()) + ) + ) + Block("1700:l000003be", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003d1", condition()) + ) + ) + Block("1720:l00000296", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003d1", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign1/gcc_O2/basicassign1-before-analysis.il.expected b/src/test/incorrect/basicassign1/gcc_O2/basicassign1-before-analysis.il.expected new file mode 100644 index 000000000..640c488c3 --- /dev/null +++ b/src/test/incorrect/basicassign1/gcc_O2/basicassign1-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000322", condition()) + ) + ) + Block("1816:l00000322", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l00000330", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000349", condition()) + ) + ) + Block("1828:l00000349", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000330", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000033c", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f9", condition()) + ) + ) + Block("1852:l000002f9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l0000052c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000223", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005be", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000239", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000399", condition()) + ) + ) + Block("1668:l00000239", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000399", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000037b", condition()) + ) + ) + Block("1704:l0000037b", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l0000038e", condition()) + ) + ) + Block("1724:l0000027e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l0000038e", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R2, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R2, bv64)[32:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000035d", condition()) + ) + ) + Block("1764:l0000035d", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000370", condition()) + ) + ) + Block("1784:l000002ba", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000370", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign1/gcc_no_plt_no_pic/basicassign1-before-analysis.il.expected b/src/test/incorrect/basicassign1/gcc_no_plt_no_pic/basicassign1-before-analysis.il.expected new file mode 100644 index 000000000..e8383cfca --- /dev/null +++ b/src/test/incorrect/basicassign1/gcc_no_plt_no_pic/basicassign1-before-analysis.il.expected @@ -0,0 +1,321 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000915", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000009c3", condition()) + ) + ) + Block("1752:l000009c3", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000009d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009ea", condition()) + ) + ) + Block("1764:l000009ea", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000009d1", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009dd", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000915", condition()) + ) + ) + Block("1788:l00000915", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1896:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000bd2", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000083f", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c69", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000855", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a3a", condition()) + ) + ) + Block("1604:l00000855", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a3a", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000089a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000a1c", condition()) + ) + ) + Block("1640:l00000a1c", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000089a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a2f", condition()) + ) + ) + Block("1660:l0000089a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a2f", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008d6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009fe", condition()) + ) + ) + Block("1700:l000009fe", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000008d6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000a11", condition()) + ) + ) + Block("1720:l000008d6", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000a11", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign1/gcc_pic/basicassign1-before-analysis.il.expected b/src/test/incorrect/basicassign1/gcc_pic/basicassign1-before-analysis.il.expected new file mode 100644 index 000000000..bbc12fe7b --- /dev/null +++ b/src/test/incorrect/basicassign1/gcc_pic/basicassign1-before-analysis.il.expected @@ -0,0 +1,321 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000387", condition()) + ) + ) + Block("1816:l00000387", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1840:l00000395", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l000003ae", condition()) + ) + ) + Block("1828:l000003ae", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000395", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000003a1", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002d5", condition()) + ) + ) + Block("1852:l000002d5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1960:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1960:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l00000535", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001ff", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l000005d5", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1668:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003fe", condition()) + ) + ) + Block("1668:l00000215", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003fe", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003e0", condition()) + ) + ) + Block("1704:l000003e0", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) + ), + jumps( + GoTo("1724:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003f3", condition()) + ) + ) + Block("1724:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003f3", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003c2", condition()) + ) + ) + Block("1764:l000003c2", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003d5", condition()) + ) + ) + Block("1784:l00000296", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003d5", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign2/clang/basicassign2-before-analysis.il.expected b/src/test/incorrect/basicassign2/clang/basicassign2-before-analysis.il.expected new file mode 100644 index 000000000..d816d7b57 --- /dev/null +++ b/src/test/incorrect/basicassign2/clang/basicassign2-before-analysis.il.expected @@ -0,0 +1,315 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000349", condition()) + ) + ) + Block("1752:l00000349", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000357", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000370", condition()) + ) + ) + Block("1764:l00000370", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000357", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000363", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002bd", condition()) + ) + ) + Block("1788:l000002bd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000552", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001e7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005e3", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003c0", condition()) + ) + ) + Block("1604:l000001fd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003c0", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003a2", condition()) + ) + ) + Block("1640:l000003a2", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003b5", condition()) + ) + ) + Block("1660:l00000242", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003b5", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R9, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv64)) + LocalAssign(Register(R10, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R9, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 64bv64)] := Register(R10, bv64))) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R8, bv64))) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 64bv64)] := Register(R8, bv64))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000384", condition()) + ) + ) + Block("1700:l00000384", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000397", condition()) + ) + ) + Block("1720:l0000027e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000397", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign2/clang_O2/basicassign2-before-analysis.il.expected b/src/test/incorrect/basicassign2/clang_O2/basicassign2-before-analysis.il.expected new file mode 100644 index 000000000..70cf214ec --- /dev/null +++ b/src/test/incorrect/basicassign2/clang_O2/basicassign2-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002e5", condition()) + ) + ) + Block("1752:l000002e5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000030c", condition()) + ) + ) + Block("1764:l0000030c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002f3", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002ff", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000299", condition()) + ) + ) + Block("1788:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004e5", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000056d", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000035c", condition()) + ) + ) + Block("1604:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000035c", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000033e", condition()) + ) + ) + Block("1640:l0000033e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000351", condition()) + ) + ) + Block("1660:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000351", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 64bv64)] := Register(R8, bv64))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000320", condition()) + ) + ) + Block("1700:l00000320", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000333", condition()) + ) + ) + Block("1720:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000333", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign2/clang_no_plt_no_pic/basicassign2-before-analysis.il.expected b/src/test/incorrect/basicassign2/clang_no_plt_no_pic/basicassign2-before-analysis.il.expected new file mode 100644 index 000000000..40e77ac2f --- /dev/null +++ b/src/test/incorrect/basicassign2/clang_no_plt_no_pic/basicassign2-before-analysis.il.expected @@ -0,0 +1,315 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008b7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000943", condition()) + ) + ) + Block("1752:l00000943", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000951", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000096a", condition()) + ) + ) + Block("1764:l0000096a", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000951", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000095d", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008b7", condition()) + ) + ) + Block("1788:l000008b7", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b4c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007e1", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000bdd", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000007f7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000009ba", condition()) + ) + ) + Block("1604:l000007f7", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000009ba", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000083c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000099c", condition()) + ) + ) + Block("1640:l0000099c", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000083c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009af", condition()) + ) + ) + Block("1660:l0000083c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009af", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R9, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv64)) + LocalAssign(Register(R10, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R9, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 64bv64)] := Register(R10, bv64))) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R8, bv64))) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 64bv64)] := Register(R8, bv64))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000878", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000097e", condition()) + ) + ) + Block("1700:l0000097e", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000878", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000991", condition()) + ) + ) + Block("1720:l00000878", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000991", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign2/clang_pic/basicassign2-before-analysis.il.expected b/src/test/incorrect/basicassign2/clang_pic/basicassign2-before-analysis.il.expected new file mode 100644 index 000000000..1694434d4 --- /dev/null +++ b/src/test/incorrect/basicassign2/clang_pic/basicassign2-before-analysis.il.expected @@ -0,0 +1,317 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000035f", condition()) + ) + ) + Block("1816:l0000035f", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) + ), + jumps( + GoTo("1840:l0000036d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000386", condition()) + ) + ) + Block("1828:l00000386", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000036d", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000379", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002c5", condition()) + ) + ) + Block("1852:l000002c5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1944:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l0000050d", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001ef", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l000005a9", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003d6", condition()) + ) + ) + Block("1668:l00000205", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003d6", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003b8", condition()) + ) + ) + Block("1704:l000003b8", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003cb", condition()) + ) + ) + Block("1724:l0000024a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003cb", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4048bv64)])) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R9, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv64)) + LocalAssign(Register(R10, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4032bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Register(R10, bv64))) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R8, bv64))) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Register(R8, bv64))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000039a", condition()) + ) + ) + Block("1764:l0000039a", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003ad", condition()) + ) + ) + Block("1784:l00000286", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003ad", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign2/gcc/basicassign2-before-analysis.il.expected b/src/test/incorrect/basicassign2/gcc/basicassign2-before-analysis.il.expected new file mode 100644 index 000000000..73cfc623a --- /dev/null +++ b/src/test/incorrect/basicassign2/gcc/basicassign2-before-analysis.il.expected @@ -0,0 +1,321 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000383", condition()) + ) + ) + Block("1752:l00000383", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000391", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003aa", condition()) + ) + ) + Block("1764:l000003aa", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000391", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000039d", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002d5", condition()) + ) + ) + Block("1788:l000002d5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1896:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000592", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001ff", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000629", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003fa", condition()) + ) + ) + Block("1604:l00000215", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003fa", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003dc", condition()) + ) + ) + Block("1640:l000003dc", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003ef", condition()) + ) + ) + Block("1660:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003ef", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 32bv64)) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv64)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Register(R1, bv64))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 32bv64)) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Register(R1, bv64))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003be", condition()) + ) + ) + Block("1700:l000003be", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003d1", condition()) + ) + ) + Block("1720:l00000296", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003d1", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign2/gcc_O2/basicassign2-before-analysis.il.expected b/src/test/incorrect/basicassign2/gcc_O2/basicassign2-before-analysis.il.expected new file mode 100644 index 000000000..095e1ac5c --- /dev/null +++ b/src/test/incorrect/basicassign2/gcc_O2/basicassign2-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000322", condition()) + ) + ) + Block("1816:l00000322", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l00000330", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000349", condition()) + ) + ) + Block("1828:l00000349", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000330", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000033c", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f9", condition()) + ) + ) + Block("1852:l000002f9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l0000052c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000223", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005be", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000239", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000399", condition()) + ) + ) + Block("1668:l00000239", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000399", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000037b", condition()) + ) + ) + Block("1704:l0000037b", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l0000038e", condition()) + ) + ) + Block("1724:l0000027e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l0000038e", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 8bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 24bv64)] := Register(R2, bv64))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000035d", condition()) + ) + ) + Block("1764:l0000035d", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000370", condition()) + ) + ) + Block("1784:l000002ba", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000370", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign2/gcc_no_plt_no_pic/basicassign2-before-analysis.il.expected b/src/test/incorrect/basicassign2/gcc_no_plt_no_pic/basicassign2-before-analysis.il.expected new file mode 100644 index 000000000..356a5add9 --- /dev/null +++ b/src/test/incorrect/basicassign2/gcc_no_plt_no_pic/basicassign2-before-analysis.il.expected @@ -0,0 +1,321 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000915", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000009c3", condition()) + ) + ) + Block("1752:l000009c3", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000009d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009ea", condition()) + ) + ) + Block("1764:l000009ea", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000009d1", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009dd", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000915", condition()) + ) + ) + Block("1788:l00000915", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1896:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000bd2", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000083f", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c69", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000855", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a3a", condition()) + ) + ) + Block("1604:l00000855", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a3a", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000089a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000a1c", condition()) + ) + ) + Block("1640:l00000a1c", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000089a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a2f", condition()) + ) + ) + Block("1660:l0000089a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a2f", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 32bv64)) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv64)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Register(R1, bv64))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 32bv64)) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Register(R1, bv64))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008d6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009fe", condition()) + ) + ) + Block("1700:l000009fe", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000008d6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000a11", condition()) + ) + ) + Block("1720:l000008d6", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000a11", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign2/gcc_pic/basicassign2-before-analysis.il.expected b/src/test/incorrect/basicassign2/gcc_pic/basicassign2-before-analysis.il.expected new file mode 100644 index 000000000..c5ccf4508 --- /dev/null +++ b/src/test/incorrect/basicassign2/gcc_pic/basicassign2-before-analysis.il.expected @@ -0,0 +1,321 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000387", condition()) + ) + ) + Block("1816:l00000387", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1840:l00000395", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l000003ae", condition()) + ) + ) + Block("1828:l000003ae", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000395", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000003a1", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002d5", condition()) + ) + ) + Block("1852:l000002d5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1960:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1960:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l00000535", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001ff", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l000005d5", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1668:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003fe", condition()) + ) + ) + Block("1668:l00000215", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003fe", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003e0", condition()) + ) + ) + Block("1704:l000003e0", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) + ), + jumps( + GoTo("1724:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003f3", condition()) + ) + ) + Block("1724:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003f3", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Register(R1, bv64))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Register(R1, bv64))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003c2", condition()) + ) + ) + Block("1764:l000003c2", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003d5", condition()) + ) + ) + Block("1784:l00000296", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003d5", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign3/clang/basicassign3-before-analysis.il.expected b/src/test/incorrect/basicassign3/clang/basicassign3-before-analysis.il.expected new file mode 100644 index 000000000..d9e01d499 --- /dev/null +++ b/src/test/incorrect/basicassign3/clang/basicassign3-before-analysis.il.expected @@ -0,0 +1,315 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000349", condition()) + ) + ) + Block("1752:l00000349", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000357", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000370", condition()) + ) + ) + Block("1764:l00000370", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000357", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000363", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002bd", condition()) + ) + ) + Block("1788:l000002bd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000552", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001e7", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005e3", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003c0", condition()) + ) + ) + Block("1604:l000001fd", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003c0", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003a2", condition()) + ) + ) + Block("1640:l000003a2", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003b5", condition()) + ) + ) + Block("1660:l00000242", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003b5", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 49bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R9, bv64)[8:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := 0bv8)) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) + LocalAssign(Register(R9, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 50bv64)] := Extract(Register(R10, bv64)[8:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 49bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 50bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000384", condition()) + ) + ) + Block("1700:l00000384", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000397", condition()) + ) + ) + Block("1720:l0000027e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000397", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign3/clang_O2/basicassign3-before-analysis.il.expected b/src/test/incorrect/basicassign3/clang_O2/basicassign3-before-analysis.il.expected new file mode 100644 index 000000000..637d9b559 --- /dev/null +++ b/src/test/incorrect/basicassign3/clang_O2/basicassign3-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000002e5", condition()) + ) + ) + Block("1752:l000002e5", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000030c", condition()) + ) + ) + Block("1764:l0000030c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000002f3", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000002ff", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000299", condition()) + ) + ) + Block("1788:l00000299", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1836:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l000004e5", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001c3", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000056d", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l0000035c", condition()) + ) + ) + Block("1604:l000001d9", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l0000035c", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000033e", condition()) + ) + ) + Block("1640:l0000033e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000351", condition()) + ) + ) + Block("1660:l0000021e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000351", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[8:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000320", condition()) + ) + ) + Block("1700:l00000320", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000333", condition()) + ) + ) + Block("1720:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000333", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign3/clang_no_plt_no_pic/basicassign3-before-analysis.il.expected b/src/test/incorrect/basicassign3/clang_no_plt_no_pic/basicassign3-before-analysis.il.expected new file mode 100644 index 000000000..a8deb5844 --- /dev/null +++ b/src/test/incorrect/basicassign3/clang_no_plt_no_pic/basicassign3-before-analysis.il.expected @@ -0,0 +1,315 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008b7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000943", condition()) + ) + ) + Block("1752:l00000943", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000951", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000096a", condition()) + ) + ) + Block("1764:l0000096a", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000951", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000095d", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008b7", condition()) + ) + ) + Block("1788:l000008b7", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b4c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007e1", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000bdd", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000007f7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000009ba", condition()) + ) + ) + Block("1604:l000007f7", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000009ba", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000083c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000099c", condition()) + ) + ) + Block("1640:l0000099c", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l0000083c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009af", condition()) + ) + ) + Block("1660:l0000083c", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009af", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 49bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R9, bv64)[8:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := 0bv8)) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) + LocalAssign(Register(R9, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 50bv64)] := Extract(Register(R10, bv64)[8:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 49bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 50bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000878", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000097e", condition()) + ) + ) + Block("1700:l0000097e", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000878", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000991", condition()) + ) + ) + Block("1720:l00000878", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000991", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign3/clang_pic/basicassign3-before-analysis.il.expected b/src/test/incorrect/basicassign3/clang_pic/basicassign3-before-analysis.il.expected new file mode 100644 index 000000000..c14c25df3 --- /dev/null +++ b/src/test/incorrect/basicassign3/clang_pic/basicassign3-before-analysis.il.expected @@ -0,0 +1,317 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l0000035f", condition()) + ) + ) + Block("1816:l0000035f", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) + ), + jumps( + GoTo("1840:l0000036d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000386", condition()) + ) + ) + Block("1828:l00000386", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l0000036d", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l00000379", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002c5", condition()) + ) + ) + Block("1852:l000002c5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1944:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l0000050d", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001ef", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l000005a9", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003d6", condition()) + ) + ) + Block("1668:l00000205", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003d6", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003b8", condition()) + ) + ) + Block("1704:l000003b8", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) + ), + jumps( + GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003cb", condition()) + ) + ) + Block("1724:l0000024a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003cb", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4048bv64)])) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R9, bv64)[8:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := 0bv8)) + LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) + LocalAssign(Register(R9, bv64) := 65536bv64) + LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4032bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R10, bv64)[8:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000039a", condition()) + ) + ) + Block("1764:l0000039a", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003ad", condition()) + ) + ) + Block("1784:l00000286", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003ad", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign3/gcc/basicassign3-before-analysis.il.expected b/src/test/incorrect/basicassign3/gcc/basicassign3-before-analysis.il.expected new file mode 100644 index 000000000..bd725719e --- /dev/null +++ b/src/test/incorrect/basicassign3/gcc/basicassign3-before-analysis.il.expected @@ -0,0 +1,321 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000383", condition()) + ) + ) + Block("1752:l00000383", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000391", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003aa", condition()) + ) + ) + Block("1764:l000003aa", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000391", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000039d", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002d5", condition()) + ) + ) + Block("1788:l000002d5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1896:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000592", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001ff", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000629", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003fa", condition()) + ) + ) + Block("1604:l00000215", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003fa", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003dc", condition()) + ) + ) + Block("1640:l000003dc", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003ef", condition()) + ) + ) + Block("1660:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003ef", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 18bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := 0bv8)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 17bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 18bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 17bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003be", condition()) + ) + ) + Block("1700:l000003be", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003d1", condition()) + ) + ) + Block("1720:l00000296", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003d1", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign3/gcc_O2/basicassign3-before-analysis.il.expected b/src/test/incorrect/basicassign3/gcc_O2/basicassign3-before-analysis.il.expected new file mode 100644 index 000000000..44a5a14c3 --- /dev/null +++ b/src/test/incorrect/basicassign3/gcc_O2/basicassign3-before-analysis.il.expected @@ -0,0 +1,306 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002f9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000322", condition()) + ) + ) + Block("1816:l00000322", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1840:l00000330", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l00000349", condition()) + ) + ) + Block("1828:l00000349", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000330", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000033c", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002f9", condition()) + ) + ) + Block("1852:l000002f9", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1424:l0000052c", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1648:l00000223", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005be", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l00000239", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l00000399", condition()) + ) + ) + Block("1668:l00000239", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l00000399", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000037b", condition()) + ) + ) + Block("1704:l0000037b", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l0000038e", condition()) + ) + ) + Block("1724:l0000027e", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l0000038e", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1536:lmain", + statements( + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 17bv64)) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R2, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 1bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 17bv64)] := Extract(Register(R2, bv64)[8:0]))) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l0000035d", condition()) + ) + ) + Block("1764:l0000035d", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000370", condition()) + ) + ) + Block("1784:l000002ba", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000370", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign3/gcc_no_plt_no_pic/basicassign3-before-analysis.il.expected b/src/test/incorrect/basicassign3/gcc_no_plt_no_pic/basicassign3-before-analysis.il.expected new file mode 100644 index 000000000..ecee37621 --- /dev/null +++ b/src/test/incorrect/basicassign3/gcc_no_plt_no_pic/basicassign3-before-analysis.il.expected @@ -0,0 +1,321 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000915", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l000009c3", condition()) + ) + ) + Block("1752:l000009c3", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l000009d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009ea", condition()) + ) + ) + Block("1764:l000009ea", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l000009d1", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009dd", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000915", condition()) + ) + ) + Block("1788:l00000915", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1896:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000bd2", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000083f", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c69", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000855", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a3a", condition()) + ) + ) + Block("1604:l00000855", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a3a", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000089a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000a1c", condition()) + ) + ) + Block("1640:l00000a1c", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000089a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000a2f", condition()) + ) + ) + Block("1660:l0000089a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000a2f", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 18bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := 0bv8)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 17bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 18bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 17bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008d6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009fe", condition()) + ) + ) + Block("1700:l000009fe", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000008d6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000a11", condition()) + ) + ) + Block("1720:l000008d6", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000a11", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/basicassign3/gcc_pic/basicassign3-before-analysis.il.expected b/src/test/incorrect/basicassign3/gcc_pic/basicassign3-before-analysis.il.expected new file mode 100644 index 000000000..786d1deaa --- /dev/null +++ b/src/test/incorrect/basicassign3/gcc_pic/basicassign3-before-analysis.il.expected @@ -0,0 +1,321 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000387", condition()) + ) + ) + Block("1816:l00000387", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1840:l00000395", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l000003ae", condition()) + ) + ) + Block("1828:l000003ae", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000395", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000003a1", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002d5", condition()) + ) + ) + Block("1852:l000002d5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1960:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1960:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l00000535", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l000001ff", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l000005d5", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1668:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l000003fe", condition()) + ) + ) + Block("1668:l00000215", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l000003fe", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000003e0", condition()) + ) + ) + Block("1704:l000003e0", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) + ), + jumps( + GoTo("1724:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l000003f3", condition()) + ) + ) + Block("1724:l0000025a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l000003f3", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := 0bv8)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000003c2", condition()) + ) + ) + Block("1764:l000003c2", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000003d5", condition()) + ) + ) + Block("1784:l00000296", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000003d5", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/iflocal/clang/iflocal-before-analysis.il.expected b/src/test/incorrect/iflocal/clang/iflocal-before-analysis.il.expected new file mode 100644 index 000000000..0f24183b2 --- /dev/null +++ b/src/test/incorrect/iflocal/clang/iflocal-before-analysis.il.expected @@ -0,0 +1,363 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002c1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000036e", condition()) + ) + ) + Block("1752:l0000036e", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000037c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000395", condition()) + ) + ) + Block("1764:l00000395", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000037c", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000388", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002c1", condition()) + ) + ) + Block("1788:l000002c1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000578", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001eb", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000062d", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000201", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003e5", condition()) + ) + ) + Block("1604:l00000201", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003e5", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000003c7", condition()) + ) + ) + Block("1640:l000003c7", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003da", condition()) + ) + ) + Block("1660:l00000246", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003da", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000334", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000337", condition()) + ) + ) + Block("?:l00000337", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l0000033a", condition()) + ) + ) + Block("?:l00000334", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l0000033a", condition()) + ) + ) + Block("?:l0000033a", + statements( + ), + jumps( + GoTo("1864:l00000342", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1848:l00000359", condition()) + ) + ) + Block("1848:l00000359", + statements( + ), + jumps( + GoTo("1852:l0000035a", condition()) + ) + ) + Block("1852:l0000035a", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1864:l00000342", condition()) + ) + ) + Block("1864:l00000342", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000003a9", condition()) + ) + ) + Block("1700:l000003a9", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000003bc", condition()) + ) + ) + Block("1720:l00000282", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000003bc", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/iflocal/clang_no_plt_no_pic/iflocal-before-analysis.il.expected b/src/test/incorrect/iflocal/clang_no_plt_no_pic/iflocal-before-analysis.il.expected new file mode 100644 index 000000000..e82270699 --- /dev/null +++ b/src/test/incorrect/iflocal/clang_no_plt_no_pic/iflocal-before-analysis.il.expected @@ -0,0 +1,363 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008e3", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000990", condition()) + ) + ) + Block("1752:l00000990", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000099e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009b7", condition()) + ) + ) + Block("1764:l000009b7", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000099e", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009aa", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008e3", condition()) + ) + ) + Block("1788:l000008e3", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b9a", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000080d", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c2c", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000823", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a07", condition()) + ) + ) + Block("1604:l00000823", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a07", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000868", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009e9", condition()) + ) + ) + Block("1640:l000009e9", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000868", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009fc", condition()) + ) + ) + Block("1660:l00000868", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009fc", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000956", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000959", condition()) + ) + ) + Block("?:l00000959", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l0000095c", condition()) + ) + ) + Block("?:l00000956", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l0000095c", condition()) + ) + ) + Block("?:l0000095c", + statements( + ), + jumps( + GoTo("1864:l00000964", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1848:l0000097b", condition()) + ) + ) + Block("1848:l0000097b", + statements( + ), + jumps( + GoTo("1852:l0000097c", condition()) + ) + ) + Block("1852:l0000097c", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1864:l00000964", condition()) + ) + ) + Block("1864:l00000964", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008a4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009cb", condition()) + ) + ) + Block("1700:l000009cb", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000008a4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009de", condition()) + ) + ) + Block("1720:l000008a4", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009de", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/iflocal/clang_pic/iflocal-before-analysis.il.expected b/src/test/incorrect/iflocal/clang_pic/iflocal-before-analysis.il.expected new file mode 100644 index 000000000..e82270699 --- /dev/null +++ b/src/test/incorrect/iflocal/clang_pic/iflocal-before-analysis.il.expected @@ -0,0 +1,363 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l000008e3", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000990", condition()) + ) + ) + Block("1752:l00000990", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l0000099e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l000009b7", condition()) + ) + ) + Block("1764:l000009b7", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000099e", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l000009aa", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000008e3", condition()) + ) + ) + Block("1788:l000008e3", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1876:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b9a", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000080d", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000c2c", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000823", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000a07", condition()) + ) + ) + Block("1604:l00000823", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000a07", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000868", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000009e9", condition()) + ) + ) + Block("1640:l000009e9", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000868", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000009fc", condition()) + ) + ) + Block("1660:l00000868", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000009fc", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000956", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000959", condition()) + ) + ) + Block("?:l00000959", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l0000095c", condition()) + ) + ) + Block("?:l00000956", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l0000095c", condition()) + ) + ) + Block("?:l0000095c", + statements( + ), + jumps( + GoTo("1864:l00000964", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1848:l0000097b", condition()) + ) + ) + Block("1848:l0000097b", + statements( + ), + jumps( + GoTo("1852:l0000097c", condition()) + ) + ) + Block("1852:l0000097c", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1864:l00000964", condition()) + ) + ) + Block("1864:l00000964", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000008a4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000009cb", condition()) + ) + ) + Block("1700:l000009cb", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000008a4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000009de", condition()) + ) + ) + Block("1720:l000008a4", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000009de", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/iflocal/gcc/iflocal-before-analysis.il.expected b/src/test/incorrect/iflocal/gcc/iflocal-before-analysis.il.expected new file mode 100644 index 000000000..654735592 --- /dev/null +++ b/src/test/incorrect/iflocal/gcc/iflocal-before-analysis.il.expected @@ -0,0 +1,330 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002b1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l0000033a", condition()) + ) + ) + Block("1752:l0000033a", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000348", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000361", condition()) + ) + ) + Block("1764:l00000361", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000348", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000354", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002b1", condition()) + ) + ) + Block("1788:l000002b1", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1860:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1860:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000540", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000001db", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l000005f2", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000001f1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000003b1", condition()) + ) + ) + Block("1604:l000001f1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000003b1", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000236", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000393", condition()) + ) + ) + Block("1640:l00000393", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000236", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000003a6", condition()) + ) + ) + Block("1660:l00000236", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000003a6", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1848:l00000318", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1840:l0000032d", condition()) + ) + ) + Block("1840:l0000032d", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1848:l00000318", condition()) + ) + ) + Block("1848:l00000318", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000272", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000375", condition()) + ) + ) + Block("1700:l00000375", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000272", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000388", condition()) + ) + ) + Block("1720:l00000272", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000388", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/iflocal/gcc_no_plt_no_pic/iflocal-before-analysis.il.expected b/src/test/incorrect/iflocal/gcc_no_plt_no_pic/iflocal-before-analysis.il.expected new file mode 100644 index 000000000..adeda0142 --- /dev/null +++ b/src/test/incorrect/iflocal/gcc_no_plt_no_pic/iflocal-before-analysis.il.expected @@ -0,0 +1,330 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000898", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000921", condition()) + ) + ) + Block("1752:l00000921", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l0000092f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000948", condition()) + ) + ) + Block("1764:l00000948", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000092f", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000093b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000898", condition()) + ) + ) + Block("1788:l00000898", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1860:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1860:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b27", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007c2", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000bb5", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000007d8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000998", condition()) + ) + ) + Block("1604:l000007d8", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000998", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000081d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000097a", condition()) + ) + ) + Block("1640:l0000097a", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000081d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000098d", condition()) + ) + ) + Block("1660:l0000081d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000098d", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1848:l000008ff", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1840:l00000914", condition()) + ) + ) + Block("1840:l00000914", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1848:l000008ff", condition()) + ) + ) + Block("1848:l000008ff", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000859", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000095c", condition()) + ) + ) + Block("1700:l0000095c", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000859", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000096f", condition()) + ) + ) + Block("1720:l00000859", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000096f", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/iflocal/gcc_pic/iflocal-before-analysis.il.expected b/src/test/incorrect/iflocal/gcc_pic/iflocal-before-analysis.il.expected new file mode 100644 index 000000000..adeda0142 --- /dev/null +++ b/src/test/incorrect/iflocal/gcc_pic/iflocal-before-analysis.il.expected @@ -0,0 +1,330 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000898", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000921", condition()) + ) + ) + Block("1752:l00000921", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l0000092f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000948", condition()) + ) + ) + Block("1764:l00000948", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000092f", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000093b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000898", condition()) + ) + ) + Block("1788:l00000898", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1860:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1860:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000b27", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l000007c2", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000bb5", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l000007d8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000998", condition()) + ) + ) + Block("1604:l000007d8", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000998", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000081d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000097a", condition()) + ) + ) + Block("1640:l0000097a", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000081d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000098d", condition()) + ) + ) + Block("1660:l0000081d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000098d", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1848:l000008ff", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1840:l00000914", condition()) + ) + ) + Block("1840:l00000914", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1848:l000008ff", condition()) + ) + ) + Block("1848:l000008ff", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000859", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000095c", condition()) + ) + ) + Block("1700:l0000095c", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l00000859", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000096f", condition()) + ) + ) + Block("1720:l00000859", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000096f", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/nestedifglobal/clang/nestedifglobal-before-analysis.il.expected b/src/test/incorrect/nestedifglobal/clang/nestedifglobal-before-analysis.il.expected new file mode 100644 index 000000000..c565ce58a --- /dev/null +++ b/src/test/incorrect/nestedifglobal/clang/nestedifglobal-before-analysis.il.expected @@ -0,0 +1,477 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000311", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000472", condition()) + ) + ) + Block("1752:l00000472", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000480", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000499", condition()) + ) + ) + Block("1764:l00000499", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000480", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000048c", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000311", condition()) + ) + ) + Block("1788:l00000311", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1956:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1956:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000690", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000023b", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l0000075b", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l00000251", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l000004e9", condition()) + ) + ) + Block("1604:l00000251", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l000004e9", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l000004cb", condition()) + ) + ) + Block("1640:l000004cb", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l000004de", condition()) + ) + ) + Block("1660:l00000296", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l000004de", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000390", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000393", condition()) + ) + ) + Block("?:l00000393", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000396", condition()) + ) + ) + Block("?:l00000390", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000396", condition()) + ) + ) + Block("?:l00000396", + statements( + ), + jumps( + GoTo("1872:l0000039e", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1856:l0000045d", condition()) + ) + ) + Block("1856:l0000045d", + statements( + ), + jumps( + GoTo("1860:l0000045e", condition()) + ) + ) + Block("1860:l0000045e", + statements( + LocalAssign(Register(R8, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1872:l0000039e", condition()) + ) + ) + Block("1872:l0000039e", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l000003ce", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l000003d1", condition()) + ) + ) + Block("?:l000003d1", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l000003d4", condition()) + ) + ) + Block("?:l000003ce", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l000003d4", condition()) + ) + ) + Block("?:l000003d4", + statements( + ), + jumps( + GoTo("1908:l000003dc", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1892:l00000448", condition()) + ) + ) + Block("1892:l00000448", + statements( + ), + jumps( + GoTo("1896:l00000449", condition()) + ) + ) + Block("1896:l00000449", + statements( + LocalAssign(Register(R8, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1908:l000003dc", condition()) + ) + ) + Block("1908:l000003dc", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) + LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000407", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l0000040a", condition()) + ) + ) + Block("?:l0000040a", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l0000040d", condition()) + ) + ) + Block("?:l00000407", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l0000040d", condition()) + ) + ) + Block("?:l0000040d", + statements( + ), + jumps( + GoTo("1944:l00000415", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1924:l0000042c", condition()) + ) + ) + Block("1924:l0000042c", + statements( + ), + jumps( + GoTo("1928:l0000042d", condition()) + ) + ) + Block("1928:l0000042d", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1944:l00000415", condition()) + ) + ) + Block("1944:l00000415", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000002d2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l000004ad", condition()) + ) + ) + Block("1700:l000004ad", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l000002d2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l000004c0", condition()) + ) + ) + Block("1720:l000002d2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l000004c0", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/nestedifglobal/clang_no_plt_no_pic/nestedifglobal-before-analysis.il.expected b/src/test/incorrect/nestedifglobal/clang_no_plt_no_pic/nestedifglobal-before-analysis.il.expected new file mode 100644 index 000000000..f3f6460d8 --- /dev/null +++ b/src/test/incorrect/nestedifglobal/clang_no_plt_no_pic/nestedifglobal-before-analysis.il.expected @@ -0,0 +1,477 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1788:l00000a61", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000bc2", condition()) + ) + ) + Block("1752:l00000bc2", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) + ), + jumps( + GoTo("1776:l00000bd0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000be9", condition()) + ) + ) + Block("1764:l00000be9", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000bd0", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000bdc", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l00000a61", condition()) + ) + ) + Block("1788:l00000a61", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1956:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1956:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000de0", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000098b", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000e86", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1604:l000009a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000c39", condition()) + ) + ) + Block("1604:l000009a1", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000c39", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l000009e6", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000c1b", condition()) + ) + ) + Block("1640:l00000c1b", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) + ), + jumps( + GoTo("1660:l000009e6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000c2e", condition()) + ) + ) + Block("1660:l000009e6", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000c2e", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) + LocalAssign(Register(R8, bv64) := 69632bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000ae0", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000ae3", condition()) + ) + ) + Block("?:l00000ae3", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000ae6", condition()) + ) + ) + Block("?:l00000ae0", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000ae6", condition()) + ) + ) + Block("?:l00000ae6", + statements( + ), + jumps( + GoTo("1872:l00000aee", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1856:l00000bad", condition()) + ) + ) + Block("1856:l00000bad", + statements( + ), + jumps( + GoTo("1860:l00000bae", condition()) + ) + ) + Block("1860:l00000bae", + statements( + LocalAssign(Register(R8, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1872:l00000aee", condition()) + ) + ) + Block("1872:l00000aee", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000b1e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000b21", condition()) + ) + ) + Block("?:l00000b21", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000b24", condition()) + ) + ) + Block("?:l00000b1e", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000b24", condition()) + ) + ) + Block("?:l00000b24", + statements( + ), + jumps( + GoTo("1908:l00000b2c", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1892:l00000b98", condition()) + ) + ) + Block("1892:l00000b98", + statements( + ), + jumps( + GoTo("1896:l00000b99", condition()) + ) + ) + Block("1896:l00000b99", + statements( + LocalAssign(Register(R8, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1908:l00000b2c", condition()) + ) + ) + Block("1908:l00000b2c", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) + LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000b57", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000b5a", condition()) + ) + ) + Block("?:l00000b5a", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l00000b5d", condition()) + ) + ) + Block("?:l00000b57", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l00000b5d", condition()) + ) + ) + Block("?:l00000b5d", + statements( + ), + jumps( + GoTo("1944:l00000b65", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1924:l00000b7c", condition()) + ) + ) + Block("1924:l00000b7c", + statements( + ), + jumps( + GoTo("1928:l00000b7d", condition()) + ) + ) + Block("1928:l00000b7d", + statements( + LocalAssign(Register(R8, bv64) := 69632bv64) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1944:l00000b65", condition()) + ) + ) + Block("1944:l00000b65", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l00000a22", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000bfd", condition()) + ) + ) + Block("1700:l00000bfd", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1720:l00000a22", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000c10", condition()) + ) + ) + Block("1720:l00000a22", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000c10", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/nestedifglobal/clang_pic/nestedifglobal-before-analysis.il.expected b/src/test/incorrect/nestedifglobal/clang_pic/nestedifglobal-before-analysis.il.expected new file mode 100644 index 000000000..3960ef554 --- /dev/null +++ b/src/test/incorrect/nestedifglobal/clang_pic/nestedifglobal-before-analysis.il.expected @@ -0,0 +1,480 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) + ), + jumps( + GoTo("1852:l0000031d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000496", condition()) + ) + ) + Block("1816:l00000496", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) + ), + jumps( + GoTo("1840:l000004a4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l000004bd", condition()) + ) + ) + Block("1828:l000004bd", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l000004a4", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l000004b0", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l0000031d", condition()) + ) + ) + Block("1852:l0000031d", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) + LocalAssign(Register(R16, bv64) := Register(R16, bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2032:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2032:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l00000644", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l00000247", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l000006f9", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1668:l0000025d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000050d", condition()) + ) + ) + Block("1668:l0000025d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000050d", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 69632bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l000002a2", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l000004ef", condition()) + ) + ) + Block("1704:l000004ef", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) + ), + jumps( + GoTo("1724:l000002a2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000502", condition()) + ) + ) + Block("1724:l000002a2", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000502", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4040bv64)])) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R8, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R9, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := 0bv32)) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l000003ab", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l000003ae", condition()) + ) + ) + Block("?:l000003ae", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l000003b1", condition()) + ) + ) + Block("?:l000003ab", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l000003b1", condition()) + ) + ) + Block("?:l000003b1", + statements( + ), + jumps( + GoTo("1944:l000003b9", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1928:l00000481", condition()) + ) + ) + Block("1928:l00000481", + statements( + ), + jumps( + GoTo("1932:l00000482", condition()) + ) + ) + Block("1932:l00000482", + statements( + LocalAssign(Register(R8, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1944:l000003b9", condition()) + ) + ) + Block("1944:l000003b9", + statements( + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l000003eb", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l000003ee", condition()) + ) + ) + Block("?:l000003ee", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l000003f1", condition()) + ) + ) + Block("?:l000003eb", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l000003f1", condition()) + ) + ) + Block("?:l000003f1", + statements( + ), + jumps( + GoTo("1980:l000003f9", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1964:l0000046c", condition()) + ) + ) + Block("1964:l0000046c", + statements( + ), + jumps( + GoTo("1968:l0000046d", condition()) + ) + ) + Block("1968:l0000046d", + statements( + LocalAssign(Register(R8, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("1980:l000003f9", condition()) + ) + ) + Block("1980:l000003f9", + statements( + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) + LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) + LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 32)) + ), + jumps( + GoTo("?:l00000424", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("?:l00000427", condition()) + ) + ) + Block("?:l00000427", + statements( + LocalAssign(Register(R8, bv64) := 1bv64) + ), + jumps( + GoTo("?:l0000042a", condition()) + ) + ) + Block("?:l00000424", + statements( + LocalAssign(Register(R8, bv64) := 0bv64) + ), + jumps( + GoTo("?:l0000042a", condition()) + ) + ) + Block("?:l0000042a", + statements( + ), + jumps( + GoTo("2020:l00000432", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) + GoTo("1996:l00000449", condition()) + ) + ) + Block("1996:l00000449", + statements( + ), + jumps( + GoTo("2000:l0000044a", condition()) + ) + ) + Block("2000:l0000044a", + statements( + LocalAssign(Register(R8, bv64) := 65536bv64) + LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) + LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R8, bv64)[32:0]))) + ), + jumps( + GoTo("2020:l00000432", condition()) + ) + ) + Block("2020:l00000432", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002de", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l000004d1", condition()) + ) + ) + Block("1764:l000004d1", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) + ), + jumps( + GoTo("1784:l000002de", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l000004e4", condition()) + ) + ) + Block("1784:l000002de", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l000004e4", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/nestedifglobal/gcc/nestedifglobal-before-analysis.il.expected b/src/test/incorrect/nestedifglobal/gcc/nestedifglobal-before-analysis.il.expected new file mode 100644 index 000000000..2666463d8 --- /dev/null +++ b/src/test/incorrect/nestedifglobal/gcc/nestedifglobal-before-analysis.il.expected @@ -0,0 +1,385 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000002fd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000421", condition()) + ) + ) + Block("1752:l00000421", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l0000042f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000448", condition()) + ) + ) + Block("1764:l00000448", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l0000042f", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l0000043b", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000002fd", condition()) + ) + ) + Block("1788:l000002fd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1936:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1936:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l0000063a", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l00000227", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000703", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l0000023d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000498", condition()) + ) + ) + Block("1604:l0000023d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000498", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l0000047a", condition()) + ) + ) + Block("1640:l0000047a", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l0000048d", condition()) + ) + ) + Block("1660:l00000282", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l0000048d", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1868:l00000381", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1860:l00000414", condition()) + ) + ) + Block("1860:l00000414", + statements( + LocalAssign(Register(R0, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1868:l00000381", condition()) + ) + ) + Block("1868:l00000381", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1896:l000003b2", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1888:l00000407", condition()) + ) + ) + Block("1888:l00000407", + statements( + LocalAssign(Register(R0, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1896:l000003b2", condition()) + ) + ) + Block("1896:l000003b2", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1924:l000003d8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1908:l000003ed", condition()) + ) + ) + Block("1908:l000003ed", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1924:l000003d8", condition()) + ) + ) + Block("1924:l000003d8", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l0000045c", condition()) + ) + ) + Block("1700:l0000045c", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l0000046f", condition()) + ) + ) + Block("1720:l000002be", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l0000046f", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/nestedifglobal/gcc_no_plt_no_pic/nestedifglobal-before-analysis.il.expected b/src/test/incorrect/nestedifglobal/gcc_no_plt_no_pic/nestedifglobal-before-analysis.il.expected new file mode 100644 index 000000000..89df1eaa9 --- /dev/null +++ b/src/test/incorrect/nestedifglobal/gcc_no_plt_no_pic/nestedifglobal-before-analysis.il.expected @@ -0,0 +1,385 @@ +Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1788:l000009f5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1752:l00000b19", condition()) + ) + ) + Block("1752:l00000b19", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + ), + jumps( + GoTo("1776:l00000b27", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000b40", condition()) + ) + ) + Block("1764:l00000b40", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1776bv64) + ), + jumps( + DirectCall("1488:__cxa_finalize", condition()) + ) + ) + Block("1776:l00000b27", + statements( + LocalAssign(Register(R30, bv64) := 1780bv64) + ), + jumps( + DirectCall("1616:deregister_tm_clones", condition()) + ) + ) + Block("1780:l00000b33", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1788:l000009f5", condition()) + ) + ) + Block("1788:l000009f5", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1472:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1936:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1936:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1408:l_init", + statements( + LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1424bv64) + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) + Block("1424:l00000d32", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1536:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1584bv64) + ), + jumps( + DirectCall("1472:__libc_start_main", condition()) + ) + ) + Block("1584:l0000091f", + statements( + LocalAssign(Register(R30, bv64) := 1588bv64) + ), + jumps( + DirectCall("1520:abort", condition()) + ) + ) + Block("?:l00000dd3", + statements( + ), + jumps( + DirectCall("1588:call_weak_fn", condition()) + ) + ) +)), +Procedure("1520:abort", in(), out(), blocks( +)), +Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1588:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1604:l00000935", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1600:l00000b90", condition()) + ) + ) + Block("1604:l00000935", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1600:l00000b90", + statements( + ), + jumps( + GoTo("1504:l__gmon_start__", condition()) + ) + ) + Block("1504:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1616:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1660:l0000097a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1640:l00000b72", condition()) + ) + ) + Block("1640:l00000b72", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) + ), + jumps( + GoTo("1660:l0000097a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1652:l00000b85", condition()) + ) + ) + Block("1660:l0000097a", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1652:l00000b85", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1808:lframe_dummy", + statements( + ), + jumps( + DirectCall("1664:register_tm_clones", condition()) + ) + ) +)), +Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1812:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1868:l00000a79", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1860:l00000b0c", condition()) + ) + ) + Block("1860:l00000b0c", + statements( + LocalAssign(Register(R0, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1868:l00000a79", condition()) + ) + ) + Block("1868:l00000a79", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1896:l00000aaa", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1888:l00000aff", condition()) + ) + ) + Block("1888:l00000aff", + statements( + LocalAssign(Register(R0, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1896:l00000aaa", condition()) + ) + ) + Block("1896:l00000aaa", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1924:l00000ad0", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1908:l00000ae5", condition()) + ) + ) + Block("1908:l00000ae5", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1924:l00000ad0", condition()) + ) + ) + Block("1924:l00000ad0", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1664:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1720:l000009b6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1700:l00000b54", condition()) + ) + ) + Block("1700:l00000b54", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1720:l000009b6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1712:l00000b67", condition()) + ) + ) + Block("1720:l000009b6", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1712:l00000b67", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), diff --git a/src/test/incorrect/nestedifglobal/gcc_pic/nestedifglobal-before-analysis.il.expected b/src/test/incorrect/nestedifglobal/gcc_pic/nestedifglobal-before-analysis.il.expected new file mode 100644 index 000000000..ee9e8fa86 --- /dev/null +++ b/src/test/incorrect/nestedifglobal/gcc_pic/nestedifglobal-before-analysis.il.expected @@ -0,0 +1,385 @@ +Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( +)), +Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1792:l__do_global_dtors_aux", + statements( + LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) + LocalAssign(Register(R19, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) + ), + jumps( + GoTo("1852:l000002fd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) + GoTo("1816:l00000425", condition()) + ) + ) + Block("1816:l00000425", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) + ), + jumps( + GoTo("1840:l00000433", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1828:l0000044c", condition()) + ) + ) + Block("1828:l0000044c", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) + LocalAssign(Register(R30, bv64) := 1840bv64) + ), + jumps( + DirectCall("1536:__cxa_finalize", condition()) + ) + ) + Block("1840:l00000433", + statements( + LocalAssign(Register(R30, bv64) := 1844bv64) + ), + jumps( + DirectCall("1680:deregister_tm_clones", condition()) + ) + ) + Block("1844:l0000043f", + statements( + LocalAssign(Register(R0, bv64) := 1bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) + ), + jumps( + GoTo("1852:l000002fd", condition()) + ) + ) + Block("1852:l000002fd", + statements( + LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1520:l__libc_start_main", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("2000:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("2000:l_fini", + statements( + LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1456:l_init", + statements( + LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) + LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) + LocalAssign(Register(R29, bv64) := Register(R31, bv64)) + LocalAssign(Register(R30, bv64) := 1472bv64) + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) + Block("1472:l000005d3", + statements( + LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1600:l_start", + statements( + LocalAssign(Register(R29, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 0bv64) + LocalAssign(Register(R5, bv64) := Register(R0, bv64)) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) + LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) + LocalAssign(Register(R6, bv64) := Register(R31, bv64)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) + LocalAssign(Register(R3, bv64) := 0bv64) + LocalAssign(Register(R4, bv64) := 0bv64) + LocalAssign(Register(R30, bv64) := 1648bv64) + ), + jumps( + DirectCall("1520:__libc_start_main", condition()) + ) + ) + Block("1648:l00000227", + statements( + LocalAssign(Register(R30, bv64) := 1652bv64) + ), + jumps( + DirectCall("1568:abort", condition()) + ) + ) + Block("?:l00000683", + statements( + ), + jumps( + DirectCall("1652:call_weak_fn", condition()) + ) + ) +)), +Procedure("1568:abort", in(), out(), blocks( +)), +Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1652:lcall_weak_fn", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) + ), + jumps( + GoTo("1668:l0000023d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) + GoTo("1664:l0000049c", condition()) + ) + ) + Block("1668:l0000023d", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1664:l0000049c", + statements( + ), + jumps( + GoTo("1552:l__gmon_start__", condition()) + ) + ) + Block("1552:l__gmon_start__", + statements( + LocalAssign(Register(R16, bv64) := 65536bv64) + LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) + LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) + ), + jumps( + IndirectCall(Register(R17, bv64), condition()) + ) + ) +)), +Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1680:lderegister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) + LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) + ), + jumps( + GoTo("1724:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) + GoTo("1704:l0000047e", condition()) + ) + ) + Block("1704:l0000047e", + statements( + LocalAssign(Register(R1, bv64) := 65536bv64) + LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) + ), + jumps( + GoTo("1724:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1716:l00000491", condition()) + ) + ) + Block("1724:l00000282", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1716:l00000491", + statements( + LocalAssign(Register(R16, bv64) := Register(R1, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), +Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1872:lframe_dummy", + statements( + ), + jumps( + DirectCall("1728:register_tm_clones", condition()) + ) + ) +)), +Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( + Block("1876:lmain", + statements( + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1932:l00000383", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1924:l00000418", condition()) + ) + ) + Block("1924:l00000418", + statements( + LocalAssign(Register(R0, bv64) := 3bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1932:l00000383", condition()) + ) + ) + Block("1932:l00000383", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1960:l000003b5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1952:l0000040b", condition()) + ) + ) + Block("1952:l0000040b", + statements( + LocalAssign(Register(R0, bv64) := 5bv64) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1960:l000003b5", condition()) + ) + ) + Block("1960:l000003b5", + statements( + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) + LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) + LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) + LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) + LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) + LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) + ), + jumps( + GoTo("1988:l000003db", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) + GoTo("1972:l000003f0", condition()) + ) + ) + Block("1972:l000003f0", + statements( + LocalAssign(Register(R0, bv64) := 65536bv64) + LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) + LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) + MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) + ), + jumps( + GoTo("1988:l000003db", condition()) + ) + ) + Block("1988:l000003db", + statements( + LocalAssign(Register(R0, bv64) := 0bv64) + LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) +)), +Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( + Block("1728:lregister_tm_clones", + statements( + LocalAssign(Register(R0, bv64) := 69632bv64) + LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := 69632bv64) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) + LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) + LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) + LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) + ), + jumps( + GoTo("1784:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) + GoTo("1764:l00000460", condition()) + ) + ) + Block("1764:l00000460", + statements( + LocalAssign(Register(R2, bv64) := 65536bv64) + LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) + ), + jumps( + GoTo("1784:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) + GoTo("1776:l00000473", condition()) + ) + ) + Block("1784:l000002be", + statements( + ), + jumps( + IndirectCall(Register(R30, bv64), condition()) + ) + ) + Block("1776:l00000473", + statements( + LocalAssign(Register(R16, bv64) := Register(R2, bv64)) + ), + jumps( + IndirectCall(Register(R16, bv64), condition()) + ) + ) +)), From c953a7ee9a505b656faea6037dc1316d1744c47d Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Mon, 23 Oct 2023 16:45:23 +1000 Subject: [PATCH 06/20] add csv test summary and timing --- src/main/scala/util/PerformanceTimer.scala | 24 +++++++++++++++++ src/test/scala/SystemTests.scala | 30 +++++++++++++++++++--- 2 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 src/main/scala/util/PerformanceTimer.scala diff --git a/src/main/scala/util/PerformanceTimer.scala b/src/main/scala/util/PerformanceTimer.scala new file mode 100644 index 000000000..ffabb450b --- /dev/null +++ b/src/main/scala/util/PerformanceTimer.scala @@ -0,0 +1,24 @@ +package util +import scala.collection.mutable +import scala.collection + + +case class PerformanceTimer(timerName: String = "") { + private var lastCheckpoint: Long = System.currentTimeMillis() + private var end: Long = 0 + private var checkpoints: mutable.Map[String, Long] = mutable.HashMap() + + def checkPoint(name: String): Long = { + val delta = elapsed() + lastCheckpoint = System.currentTimeMillis() + checkpoints.put(name, delta) + Logger.info(s"PerformanceTimer $timerName [$name]: ${delta}ms") + delta + } + def elapsed() : Long = { + System.currentTimeMillis() - lastCheckpoint + } + + def checkPoints(): scala.collection.Map[String, Long] = checkpoints + +} diff --git a/src/test/scala/SystemTests.scala b/src/test/scala/SystemTests.scala index 00b0f40a3..3b4672b85 100644 --- a/src/test/scala/SystemTests.scala +++ b/src/test/scala/SystemTests.scala @@ -1,7 +1,9 @@ import org.scalatest.funsuite.AnyFunSuite -import util.Logger +import util.{Logger, PerformanceTimer} + import java.io.{BufferedWriter, File, FileWriter} +import scala.collection.mutable import scala.io.Source import scala.sys.process.* @@ -9,11 +11,19 @@ import scala.sys.process.* * directory structure and file-name patterns. */ class SystemTests extends AnyFunSuite { + val testPath = "./src/test/" val correctPath = "./src/test/correct" val correctPrograms: Array[String] = getSubdirectories(correctPath) val incorrectPath = "./src/test/incorrect" val incorrectPrograms: Array[String] = getSubdirectories(incorrectPath) + case class TestResult(passed: Boolean, verified: Boolean, shouldVerify: Boolean, hasExpected: Boolean, matchesExpected: Boolean, translateTime: Long, verifyTime: Long) { + final val csvHeader = "passed,verified,shouldVerify,hasExpected,matchesExpected,translateTime,verifyTime" + val toCsv = s"$passed,$verified,$shouldVerify,$hasExpected,$matchesExpected,$translateTime,$verifyTime" + } + + val testResults: mutable.Map[String, TestResult] = mutable.HashMap() + // get all variations of each program for (p <- correctPrograms) { val path = correctPath + "/" + p @@ -35,7 +45,8 @@ class SystemTests extends AnyFunSuite { ) } - def runTest(path: String, name: String, variation: String, shouldVerify: Boolean): Unit = { + + def runTest(path: String, name: String, variation: String, shouldVerify: Boolean): Unit= { val directoryPath = path + "/" + name + "/" val variationPath = directoryPath + variation + "/" + name val specPath = directoryPath + name + ".spec" @@ -44,13 +55,16 @@ class SystemTests extends AnyFunSuite { val ADTPath = variationPath + ".adt" val RELFPath = variationPath + ".relf" Logger.info(outPath) + val timer = PerformanceTimer(s"test $name/$variation") if (File(specPath).exists) { Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--spec", specPath, "--output", outPath, "--dump-il", ilPath)) } else { Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--output", outPath, "--dump-il", ilPath)) } + val translateTime = timer.checkPoint("translate-boogie") Logger.info(outPath + " done") val boogieResult = Seq("boogie", "/timeLimit:10", "/printVerifiedProceduresCount:0", "/useArrayAxioms", outPath).!! + val verifyTime = timer.checkPoint("verify") val resultPath = variationPath + "_result.txt" log(boogieResult, resultPath) val verified = boogieResult.strip().equals("Boogie program verifier finished with 0 errors") @@ -59,14 +73,22 @@ class SystemTests extends AnyFunSuite { else "Expected verification failure, but got success." val expectedOutPath = variationPath + ".expected" - if (File(expectedOutPath).exists) { + val hasExpected = File(expectedOutPath).exists + var matchesExpected = true + if (hasExpected) { if (!compareFiles(expectedOutPath, outPath)) { + matchesExpected = false info("Warning: Boogie file differs from expected") } } else { info("Note: this test has not previously succeeded") } - if (verified != shouldVerify) fail(failureMsg) + val passed = verified == shouldVerify + val result = TestResult(passed, verified, shouldVerify, hasExpected, matchesExpected, translateTime, verifyTime) + testResults.put(s"$name/$variation", result) + val csv: String = "testCase," + result.csvHeader + System.lineSeparator() + testResults.map(r => s"${r._1},${r._2.toCsv}").mkString(System.lineSeparator()) + log(csv, testPath + "summary.csv") + if (!passed) fail(failureMsg) } def compareFiles(path1: String, path2: String): Boolean = { From b2e640613fbd49255e15a5df1513dc9a20df010c Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Mon, 23 Oct 2023 17:07:22 +1000 Subject: [PATCH 07/20] add test summary --- src/test/summary.csv | 387 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 387 insertions(+) create mode 100644 src/test/summary.csv diff --git a/src/test/summary.csv b/src/test/summary.csv new file mode 100644 index 000000000..0e033cfea --- /dev/null +++ b/src/test/summary.csv @@ -0,0 +1,387 @@ +testCase,passed,verified,shouldVerify,hasExpected,matchesExpected,translateTime,verifyTime +no_interference_update_y/clang,true,true,true,true,true,5,627 +basic_lock_read/gcc_no_plt_no_pic,true,true,true,true,true,9,582 +no_interference_update_x/gcc_no_plt_no_pic,true,true,true,true,true,4,599 +iflocal/clang_pic,true,false,false,true,true,7,532 +simple_jump/clang_O2,true,true,true,true,true,5,527 +malloc_with_local/gcc_pic,true,true,true,true,true,11,567 +basicassign_gamma0/gcc_O2,true,true,true,true,true,8,563 +switch/gcc_no_plt_no_pic,true,true,true,true,true,9,566 +basicassign1/clang_O2,true,false,false,true,true,3,550 +basic_assign_increment/gcc_pic,true,true,true,true,true,5,549 +function/clang,true,true,true,true,true,7,543 +basic_function_call_caller/gcc_pic,true,true,true,true,true,12,592 +basic_arrays_write/clang_O2,true,true,true,true,true,17,539 +basic_sec_policy_write/clang_O2,true,true,true,true,true,8,545 +initialisation/clang_no_plt_no_pic,true,true,true,true,true,6,582 +basic_arrays_write/gcc_no_plt_no_pic,true,true,true,true,true,5,593 +basic_lock_security_write/clang_O2,true,true,true,true,true,6,512 +switch2/clang_pic,false,false,true,false,true,9,808 +basic_lock_security_write/gcc,true,true,true,true,true,6,573 +secret_write/clang_pic,true,true,true,true,true,5,3366 +initialisation/gcc_no_plt_no_pic,true,true,true,true,true,10,544 +initialisation/clang_O2,true,true,true,true,true,4,567 +cjump/gcc,true,true,true,true,true,19,528 +switch/gcc_O2,true,true,true,true,true,3,504 +cjump/gcc_pic,true,true,true,true,true,5,553 +basic_sec_policy_write/clang,true,true,true,true,true,11,559 +using_gamma_write_z/gcc_pic,true,true,true,true,true,3,575 +basic_sec_policy_write/clang_no_plt_no_pic,true,true,true,true,true,5,549 +basic_lock_security_read/gcc_no_plt_no_pic,true,true,true,true,true,4,569 +switch2/clang_O2,true,true,true,true,true,3,537 +basic_lock_security_read/clang_no_plt_no_pic,true,true,true,true,true,6,579 +basic_lock_security_write/gcc_pic,true,true,true,true,true,9,576 +basicfree/clang_O2,true,true,true,true,true,4,497 +basic_function_call_reader/clang_pic,true,true,true,true,true,6,543 +functions_with_params/gcc_O2,true,true,true,true,true,4,522 +arrays_simple/gcc_O2,true,true,true,true,true,14,517 +basicassign_gamma0/gcc_no_plt_no_pic,true,true,true,true,true,10,591 +basic_assign_assign/clang_O2,true,true,true,true,true,7,522 +arrays_simple/gcc_pic,false,false,true,false,true,14,746 +no_interference_update_x/clang_pic,true,true,true,true,true,5,577 +basic_lock_security_read/gcc_O2,true,true,true,true,true,13,570 +ifbranches/gcc_pic,true,true,true,true,true,6,572 +multi_malloc/gcc,true,true,true,true,true,11,554 +syscall/gcc,true,true,true,true,true,6,541 +simple_jump/gcc_no_plt_no_pic,true,true,true,true,true,3,556 +no_interference_update_y/clang_O2,true,true,true,true,true,5,575 +basic_lock_unlock/gcc_pic,true,true,true,true,true,9,570 +arrays_simple/clang_O2,true,true,true,true,true,17,507 +basic_lock_security_read/gcc_pic,true,true,true,true,true,11,557 +basicassign2/gcc_O2,true,false,false,true,true,3,519 +ifglobal/clang_O2,true,true,true,true,true,13,528 +basicassign3/gcc_O2,true,false,false,true,true,7,572 +syscall/clang_no_plt_no_pic,true,true,true,true,true,5,539 +basic_operation_evaluation/clang_pic,true,true,true,true,true,5,568 +function1/gcc,true,true,true,true,true,5,561 +nestedif/gcc_O2,true,true,true,true,true,5,512 +using_gamma_conditional/clang_no_plt_no_pic,true,true,true,true,true,12,556 +jumptable2/gcc_O2,false,false,true,false,true,11,593 +malloc_with_local2/gcc_no_plt_no_pic,true,true,true,true,true,7,538 +basic_lock_read/clang_pic,true,true,true,true,true,5,549 +basicassign1/gcc_no_plt_no_pic,true,false,false,true,true,5,552 +using_gamma_write_z/gcc_O2,true,true,true,true,true,8,564 +malloc_with_local3/clang_pic,true,true,true,true,true,16,588 +switch2/gcc,true,true,true,true,true,11,655 +simple_jump/clang,true,true,true,true,true,4,556 +indirect_call/clang_no_plt_no_pic,false,false,true,false,true,10,588 +ifbranches/gcc_no_plt_no_pic,true,true,true,true,true,5,575 +basic_function_call_caller/gcc,true,true,true,true,true,6,598 +jumptable2/gcc_pic,false,false,true,false,true,10,600 +basicfree/gcc_no_plt_no_pic,true,true,true,true,true,5,527 +indirect_call/gcc_no_plt_no_pic,false,false,true,false,true,4,586 +basic_function_call_caller/gcc_O2,true,true,true,true,true,4,533 +basic_arrays_read/gcc_O2,true,true,true,true,true,11,511 +malloc_with_local3/clang,true,true,true,true,true,7,572 +ifglobal/gcc,true,true,true,true,true,10,541 +jumptable2/gcc_no_plt_no_pic,false,false,true,false,true,5,548 +basicfree/clang_no_plt_no_pic,true,true,true,true,true,7,534 +jumptable/clang_pic,false,false,true,false,true,4,591 +using_gamma_write_z/clang,true,true,true,true,true,4,537 +basic_sec_policy_write/gcc_pic,true,true,true,true,true,15,616 +basic_arrays_read/clang_O2,true,true,true,true,true,15,550 +basic_assign_increment/gcc_no_plt_no_pic,true,true,true,true,true,5,532 +basic_operation_evaluation/clang_no_plt_no_pic,true,true,true,true,true,7,559 +basic_loop_assign/clang_no_plt_no_pic,true,true,true,true,true,4,521 +basic_function_call_caller/clang,true,true,true,true,true,18,571 +secret_write/clang_O2,true,true,true,true,true,8,567 +jumptable3/gcc,true,true,true,true,true,15,653 +basic_lock_security_write/clang,true,true,true,true,true,9,540 +nestedifglobal/gcc,true,false,false,true,true,9,592 +secret_write/gcc_no_plt_no_pic,true,true,true,true,true,8,2471 +basic_function_call_reader/gcc_pic,true,true,true,true,true,11,587 +basic_sec_policy_read/clang,true,true,true,true,true,5,538 +simple_jump/gcc,true,true,true,true,true,3,545 +ifglobal/gcc_O2,true,true,true,true,true,11,540 +arrays_simple/gcc,false,false,true,false,true,23,728 +switch2/gcc_no_plt_no_pic,true,true,true,true,true,6,643 +nestedifglobal/gcc_pic,true,false,false,true,true,7,795 +syscall/clang_O2,false,false,true,false,true,7,539 +basic_function_call_reader/clang_O2,true,true,true,true,true,14,546 +syscall/gcc_pic,true,true,true,true,true,3,544 +basic_lock_read/clang_O2,true,true,true,true,true,6,542 +basic_sec_policy_read/gcc_pic,true,true,true,true,true,7,572 +function1/clang_pic,true,true,true,true,true,10,564 +basicassign_gamma0/clang,true,true,true,true,true,7,541 +basic_function_call_caller/clang_pic,true,true,true,true,true,17,593 +secret_write/gcc_O2,true,true,true,true,true,3,560 +basic_assign_assign/clang,true,true,true,true,true,21,513 +basicassign/gcc_no_plt_no_pic,true,false,false,true,true,7,974 +jumptable3/clang_no_plt_no_pic,false,false,true,false,true,5,703 +basic_lock_unlock/clang,true,true,true,true,true,6,545 +jumptable2/clang_pic,false,false,true,false,true,10,582 +basic_lock_security_read/clang,true,true,true,true,true,8,552 +nestedif/clang_pic,true,true,true,true,true,7,583 +basic_function_call_reader/gcc_no_plt_no_pic,true,true,true,true,true,8,578 +multi_malloc/gcc_O2,true,true,true,true,true,7,527 +secret_write/gcc,true,true,true,true,true,6,2418 +no_interference_update_y/gcc,true,true,true,true,true,6,568 +using_gamma_write_z/clang_O2,true,true,true,true,true,5,579 +nestedifglobal/clang,true,false,false,true,true,6,602 +basicassign1/gcc,true,false,false,true,true,9,582 +functionpointer/gcc_no_plt_no_pic,false,false,true,false,true,18,633 +basic_assign_increment/gcc_O2,true,true,true,true,true,9,532 +basicassign2/clang_O2,true,false,false,true,true,4,569 +basic_lock_security_read/gcc,true,true,true,true,true,7,545 +ifglobal/clang_pic,true,true,true,true,true,5,536 +basicassign_gamma0/clang_O2,true,true,true,true,true,3,534 +using_gamma_conditional/gcc,true,true,true,true,true,8,555 +malloc_with_local2/gcc_O2,true,true,true,true,true,10,548 +jumptable3/gcc_no_plt_no_pic,true,true,true,true,true,14,648 +initialisation/gcc,true,true,true,true,true,5,561 +basicassign_gamma0/gcc_pic,true,true,true,true,true,8,566 +basic_assign_assign/clang_no_plt_no_pic,true,true,true,true,true,9,572 +basic_sec_policy_write/gcc,true,true,true,true,true,20,577 +basic_assign_increment/clang,true,true,true,true,true,11,540 +jumptable2/gcc,false,false,true,false,true,9,591 +basicassign3/clang_pic,true,false,false,true,true,3,560 +function/gcc_pic,true,true,true,true,true,16,548 +iflocal/clang,true,false,false,true,true,7,543 +basic_loop_assign/clang,true,true,true,true,true,15,571 +basic_operation_evaluation/gcc,true,true,true,true,true,6,586 +basic_lock_unlock/gcc,true,true,true,true,true,9,548 +arrays_simple/clang_pic,true,true,true,true,true,10,523 +basicassign3/clang,true,false,false,true,true,6,562 +basicfree/gcc_pic,true,true,true,true,true,9,550 +using_gamma_conditional/clang_O2,true,true,true,true,true,8,545 +jumptable/gcc,false,false,true,false,true,6,618 +switch/clang,true,true,true,true,true,6,565 +jumptable3/gcc_O2,true,true,true,true,true,6,609 +basic_sec_policy_read/gcc_O2,true,true,true,true,true,16,540 +functions_with_params/clang_O2,true,true,true,true,true,3,528 +function1/clang_O2,true,true,true,true,true,9,530 +basicassign1/clang_no_plt_no_pic,true,false,false,true,true,3,608 +basic_operation_evaluation/gcc_O2,true,true,true,true,true,4,553 +basic_lock_read/clang_no_plt_no_pic,true,true,true,true,true,7,560 +basic_function_call_caller/clang_O2,true,true,true,true,true,21,537 +functions_with_params/clang_no_plt_no_pic,true,true,true,true,true,4,544 +indirect_call/clang_pic,false,false,true,false,true,14,591 +multi_malloc/clang_O2,true,true,true,true,true,6,540 +basicassign2/clang,true,false,false,true,true,4,604 +basic_loop_assign/clang_O2,true,true,true,true,true,6,535 +basicassign/clang_no_plt_no_pic,true,false,false,true,true,3,826 +basic_assign_assign/gcc_O2,true,true,true,true,true,7,542 +basic_arrays_write/gcc_O2,true,true,true,true,true,6,648 +malloc_with_local2/clang_no_plt_no_pic,true,true,true,true,true,13,560 +basicassign3/gcc,true,false,false,true,true,3,556 +basic_function_call_caller/clang_no_plt_no_pic,true,true,true,true,true,15,557 +basic_loop_assign/gcc_no_plt_no_pic,true,true,true,true,true,9,566 +switch2/clang_no_plt_no_pic,false,false,true,false,true,5,819 +basic_assign_assign/clang_pic,true,true,true,true,true,9,590 +basic_function_call_reader/clang_no_plt_no_pic,true,true,true,true,true,9,547 +ifbranches/gcc_O2,true,true,true,true,true,9,529 +basic_sec_policy_read/clang_O2,true,true,true,true,true,7,557 +malloc_with_local/gcc_O2,true,true,true,true,true,6,563 +arrays_simple/clang_no_plt_no_pic,true,true,true,true,true,23,518 +multi_malloc/clang,true,true,true,true,true,10,548 +no_interference_update_x/gcc,true,true,true,true,true,7,578 +nestedif/clang_no_plt_no_pic,true,true,true,true,true,7,562 +basic_arrays_write/clang_no_plt_no_pic,true,true,true,true,true,9,566 +ifglobal/gcc_pic,true,true,true,true,true,4,547 +functions_with_params/gcc_no_plt_no_pic,true,true,true,true,true,8,550 +basicassign2/gcc,true,false,false,true,true,6,575 +basicassign/gcc,true,false,false,true,true,6,1001 +ifbranches/clang_O2,true,true,true,true,true,3,527 +basic_lock_read/gcc_pic,true,true,true,true,true,7,545 +function1/gcc_O2,true,true,true,true,true,6,521 +syscall/clang_pic,true,true,true,true,true,4,555 +no_interference_update_x/clang_O2,true,true,true,true,true,8,572 +no_interference_update_y/gcc_no_plt_no_pic,true,true,true,true,true,5,584 +using_gamma_write_z/clang_no_plt_no_pic,true,true,true,true,true,4,538 +ifglobal/gcc_no_plt_no_pic,true,true,true,true,true,4,539 +functionpointer/gcc_O2,false,false,true,false,true,21,578 +nestedif/gcc,true,true,true,true,true,5,550 +indirect_call/gcc_O2,true,true,true,true,true,12,531 +basic_lock_unlock/clang_O2,true,true,true,true,true,7,522 +jumptable3/gcc_pic,true,true,true,true,true,15,672 +basic_lock_read/clang,true,true,true,true,true,9,551 +basicassign3/clang_no_plt_no_pic,true,false,false,true,true,8,561 +jumptable3/clang_O2,false,false,true,false,true,8,548 +basic_assign_increment/gcc,true,true,true,true,true,11,562 +nestedif/gcc_pic,true,true,true,true,true,4,549 +basic_lock_security_write/gcc_no_plt_no_pic,true,true,true,true,true,9,558 +nestedif/clang_O2,true,true,true,true,true,6,533 +basic_lock_unlock/clang_no_plt_no_pic,true,true,true,true,true,4,550 +secret_write/clang_no_plt_no_pic,true,true,true,true,true,6,913 +jumptable2/clang_no_plt_no_pic,false,false,true,false,true,8,583 +basic_assign_increment/clang_O2,true,true,true,true,true,9,525 +basic_arrays_read/gcc_pic,true,true,true,true,true,6,507 +malloc_with_local2/clang_O2,true,true,true,true,true,4,553 +functionpointer/gcc,false,false,true,false,true,9,661 +basicassign3/gcc_pic,true,false,false,true,true,8,587 +basic_lock_unlock/clang_pic,true,true,true,true,true,4,571 +functions_with_params/clang_pic,true,true,true,true,true,9,538 +syscall/gcc_no_plt_no_pic,true,true,true,true,true,4,522 +secret_write/gcc_pic,true,true,true,true,true,9,4440 +basicassign1/clang,true,false,false,true,true,4,570 +indirect_call/clang,false,false,true,false,true,8,617 +ifbranches/gcc,true,true,true,true,true,5,572 +basic_assign_increment/clang_no_plt_no_pic,true,true,true,true,true,7,520 +basic_operation_evaluation/clang,true,true,true,true,true,9,571 +function/gcc_no_plt_no_pic,true,true,true,true,true,22,527 +basic_sec_policy_write/clang_pic,true,true,true,true,true,4,562 +basic_lock_unlock/gcc_no_plt_no_pic,true,true,true,true,true,7,558 +basic_lock_security_read/clang_O2,true,true,true,true,true,5,528 +malloc_with_local3/gcc_O2,true,true,true,true,true,11,562 +nestedifglobal/gcc_no_plt_no_pic,true,false,false,true,true,9,596 +cjump/clang_pic,true,true,true,true,true,9,572 +basic_sec_policy_write/gcc_O2,true,true,true,true,true,6,560 +multi_malloc/clang_no_plt_no_pic,true,true,true,true,true,7,530 +initialisation/clang_pic,true,true,true,true,true,11,603 +basic_function_call_reader/gcc,true,true,true,true,true,5,561 +basicassign/gcc_O2,true,false,false,true,true,5,596 +jumptable/clang,false,false,true,false,true,6,588 +basic_lock_security_write/gcc_O2,true,true,true,true,true,7,547 +basicfree/clang,true,true,true,true,true,8,508 +basicfree/gcc_O2,true,true,true,true,true,6,502 +basic_loop_assign/gcc_O2,true,true,true,true,true,7,554 +initialisation/gcc_O2,true,true,true,true,true,9,532 +jumptable2/clang_O2,false,false,true,false,true,4,573 +jumptable/clang_O2,true,true,true,true,true,8,528 +using_gamma_conditional/clang_pic,true,true,true,true,true,9,583 +malloc_with_local/gcc,true,true,true,true,true,7,557 +basic_sec_policy_read/gcc,true,true,true,true,true,6,564 +simple_jump/clang_pic,true,true,true,true,true,4,539 +switch/gcc,true,true,true,true,true,3,555 +jumptable/gcc_O2,true,true,true,true,true,11,571 +no_interference_update_x/clang_no_plt_no_pic,true,true,true,true,true,6,567 +basicassign/gcc_pic,true,false,false,true,true,5,4080 +nestedifglobal/clang_pic,true,false,false,true,true,7,972 +basic_lock_security_write/clang_pic,true,true,true,true,true,6,546 +basic_arrays_write/gcc,true,true,true,true,true,6,604 +basic_lock_unlock/gcc_O2,true,true,true,true,true,8,542 +basic_sec_policy_read/clang_no_plt_no_pic,true,true,true,true,true,10,532 +syscall/clang,true,true,true,true,true,7,552 +switch/gcc_pic,true,true,true,true,true,5,537 +no_interference_update_y/clang_no_plt_no_pic,true,true,true,true,true,7,569 +no_interference_update_x/gcc_O2,true,true,true,true,true,3,567 +basicassign/clang_pic,true,false,false,true,true,5,2370 +basic_function_call_caller/gcc_no_plt_no_pic,true,true,true,true,true,25,628 +function1/clang_no_plt_no_pic,true,true,true,true,true,19,564 +basicassign2/clang_pic,true,false,false,true,true,7,595 +using_gamma_conditional/gcc_no_plt_no_pic,true,true,true,true,true,5,543 +multi_malloc/gcc_no_plt_no_pic,true,true,true,true,true,5,559 +cjump/clang_no_plt_no_pic,true,true,true,true,true,6,546 +functionpointer/gcc_pic,false,false,true,false,true,12,595 +iflocal/gcc,true,false,false,true,true,6,566 +ifglobal/clang_no_plt_no_pic,true,true,true,true,true,4,522 +iflocal/gcc_no_plt_no_pic,true,false,false,true,true,4,567 +malloc_with_local/gcc_no_plt_no_pic,true,true,true,true,true,8,570 +functionpointer/clang_O2,false,false,true,false,true,10,567 +malloc_with_local2/clang_pic,true,true,true,true,true,7,535 +basic_function_call_reader/gcc_O2,true,true,true,true,true,9,544 +simple_jump/gcc_pic,true,true,true,true,true,6,561 +malloc_with_local/clang,true,true,true,true,true,6,532 +basic_lock_read/gcc_O2,true,true,true,true,true,7,561 +malloc_with_local/clang_pic,true,true,true,true,true,7,560 +malloc_with_local2/clang,true,true,true,true,true,5,542 +iflocal/gcc_pic,true,false,false,true,true,6,557 +ifbranches/clang_no_plt_no_pic,true,true,true,true,true,6,592 +basic_arrays_write/clang_pic,true,true,true,true,true,5,578 +basic_sec_policy_read/gcc_no_plt_no_pic,true,true,true,true,true,9,548 +initialisation/clang,true,true,true,true,true,9,554 +functionpointer/clang_pic,false,false,true,false,true,12,618 +basic_assign_increment/clang_pic,true,true,true,true,true,11,569 +using_gamma_conditional/gcc_pic,true,true,true,true,true,4,536 +basic_loop_assign/gcc_pic,true,true,true,true,true,6,564 +syscall/gcc_O2,true,true,true,true,true,6,491 +cjump/gcc_no_plt_no_pic,true,true,true,true,true,7,531 +arrays_simple/clang,true,true,true,true,true,232,515 +jumptable3/clang_pic,false,false,true,false,true,10,678 +malloc_with_local3/gcc_pic,true,true,true,true,true,10,581 +function/gcc,true,true,true,true,true,13,522 +nestedifglobal/clang_no_plt_no_pic,true,false,false,true,true,7,613 +basic_loop_assign/gcc,true,true,true,true,true,7,563 +functionpointer/clang,false,false,true,false,true,16,615 +multi_malloc/gcc_pic,true,true,true,true,true,5,537 +basic_arrays_read/clang_no_plt_no_pic,true,true,true,true,true,12,539 +no_interference_update_x/gcc_pic,true,true,true,true,true,6,623 +basicfree/gcc,true,true,true,true,true,5,544 +basicassign1/clang_pic,true,false,false,true,true,5,582 +function1/gcc_no_plt_no_pic,true,true,true,true,true,6,551 +basicassign/clang,true,false,false,true,true,8,850 +basic_lock_security_write/clang_no_plt_no_pic,true,true,true,true,true,5,544 +functionpointer/clang_no_plt_no_pic,false,false,true,false,true,6,586 +using_gamma_conditional/gcc_O2,true,true,true,true,true,4,546 +function/clang_pic,true,true,true,true,true,6,572 +switch/clang_pic,true,true,true,true,true,4,575 +basic_arrays_read/gcc,true,true,true,true,true,13,538 +using_gamma_write_z/clang_pic,true,true,true,true,true,9,604 +basic_sec_policy_write/gcc_no_plt_no_pic,true,true,true,true,true,10,553 +basic_loop_assign/clang_pic,true,true,true,true,true,8,544 +switch2/clang,false,false,true,false,true,10,807 +nestedif/clang,true,true,true,true,true,5,577 +ifbranches/clang,true,true,true,true,true,8,599 +basicassign_gamma0/clang_no_plt_no_pic,true,true,true,true,true,3,535 +basic_assign_assign/gcc,true,true,true,true,true,5,512 +malloc_with_local3/clang_no_plt_no_pic,true,true,true,true,true,11,584 +switch/clang_no_plt_no_pic,true,true,true,true,true,4,556 +basic_arrays_read/clang,true,true,true,true,true,24,531 +basic_operation_evaluation/gcc_pic,true,true,true,true,true,6,558 +function/clang_no_plt_no_pic,true,true,true,true,true,4,545 +malloc_with_local/clang_O2,true,true,true,true,true,4,532 +simple_jump/clang_no_plt_no_pic,true,true,true,true,true,7,554 +indirect_call/gcc_pic,false,false,true,false,true,6,586 +using_gamma_write_z/gcc,true,true,true,true,true,9,591 +basicassign_gamma0/gcc,true,true,true,true,true,7,563 +function1/gcc_pic,true,true,true,true,true,10,535 +jumptable2/clang,false,false,true,false,true,4,563 +cjump/clang_O2,true,true,true,true,true,4,517 +using_gamma_conditional/clang,true,true,true,true,true,3,571 +basicassign2/gcc_pic,true,false,false,true,true,10,635 +switch2/gcc_O2,true,true,true,true,true,8,536 +no_interference_update_y/gcc_O2,true,true,true,true,true,5,654 +function1/clang,true,true,true,true,true,8,575 +ifglobal/clang,true,true,true,true,true,7,525 +malloc_with_local2/gcc,true,true,true,true,true,13,576 +functions_with_params/gcc,true,true,true,true,true,4,530 +basicassign1/gcc_O2,true,false,false,true,true,7,549 +nestedif/gcc_no_plt_no_pic,true,true,true,true,true,4,538 +multi_malloc/clang_pic,true,true,true,true,true,10,560 +jumptable/clang_no_plt_no_pic,false,false,true,false,true,11,629 +jumptable3/clang,false,false,true,false,true,13,717 +basic_lock_read/gcc,true,true,true,true,true,13,565 +functions_with_params/gcc_pic,true,true,true,true,true,9,544 +indirect_call/clang_O2,true,true,true,true,true,20,517 +jumptable/gcc_pic,false,false,true,false,true,11,626 +basicassign2/clang_no_plt_no_pic,true,false,false,true,true,5,598 +basicassign/clang_O2,true,false,false,true,true,4,568 +indirect_call/gcc,false,false,true,false,true,9,584 +ifbranches/clang_pic,true,true,true,true,true,4,594 +basic_arrays_write/clang,true,true,true,true,true,9,523 +basicassign_gamma0/clang_pic,true,true,true,true,true,13,583 +basicassign3/clang_O2,true,false,false,true,true,7,558 +basicassign1/gcc_pic,true,false,false,true,true,9,569 +basicfree/clang_pic,true,true,true,true,true,22,524 +basic_sec_policy_read/clang_pic,true,true,true,true,true,4,539 +function/clang_O2,true,true,true,true,true,4,510 +basicassign3/gcc_no_plt_no_pic,true,false,false,true,true,7,583 +function/gcc_O2,true,true,true,true,true,7,538 +basic_arrays_write/gcc_pic,true,true,true,true,true,6,580 +initialisation/gcc_pic,true,true,true,true,true,4,737 +basic_lock_security_read/clang_pic,true,true,true,true,true,8,578 +basicassign2/gcc_no_plt_no_pic,true,false,false,true,true,4,598 +basic_operation_evaluation/gcc_no_plt_no_pic,true,true,true,true,true,8,557 +no_interference_update_y/clang_pic,true,true,true,true,true,5,612 +basic_assign_assign/gcc_no_plt_no_pic,true,true,true,true,true,5,566 +malloc_with_local2/gcc_pic,true,true,true,true,true,6,564 +cjump/clang,true,true,true,true,true,5,534 +basic_operation_evaluation/clang_O2,true,true,true,true,true,4,501 +malloc_with_local3/gcc,true,true,true,true,true,11,580 +basic_assign_assign/gcc_pic,true,true,true,true,true,6,563 +basic_function_call_reader/clang,true,true,true,true,true,7,544 +secret_write/clang,true,true,true,true,true,11,964 +functions_with_params/clang,true,true,true,true,true,13,514 +switch2/gcc_pic,true,true,true,true,true,5,644 +malloc_with_local/clang_no_plt_no_pic,true,true,true,true,true,7,576 +iflocal/clang_no_plt_no_pic,true,false,false,true,true,6,564 +switch/clang_O2,true,true,true,true,true,7,509 +no_interference_update_y/gcc_pic,true,true,true,true,true,3,574 +no_interference_update_x/clang,true,true,true,true,true,3,588 +malloc_with_local3/gcc_no_plt_no_pic,true,true,true,true,true,6,578 +using_gamma_write_z/gcc_no_plt_no_pic,true,true,true,true,true,3,534 +malloc_with_local3/clang_O2,true,true,true,true,true,6,547 +basic_arrays_read/clang_pic,true,true,true,true,true,13,514 +basic_arrays_read/gcc_no_plt_no_pic,true,true,true,true,true,6,507 +cjump/gcc_O2,true,true,true,true,true,3,513 +simple_jump/gcc_O2,true,true,true,true,true,6,533 \ No newline at end of file From 37c066109acb398a743115e95b6f3c171663c0cf Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Mon, 23 Oct 2023 17:07:40 +1000 Subject: [PATCH 08/20] and condition on store generator --- src/main/scala/translating/IRToBoogie.scala | 25 ++++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/main/scala/translating/IRToBoogie.scala b/src/main/scala/translating/IRToBoogie.scala index e7a03d08e..783681451 100644 --- a/src/main/scala/translating/IRToBoogie.scala +++ b/src/main/scala/translating/IRToBoogie.scala @@ -2,7 +2,7 @@ package translating import ir.* import boogie.* import specification.* -import util.BoogieGeneratorConfig +import util.{BoogieGeneratorConfig, BoogieMemoryAccessMode} import scala.collection.mutable.ArrayBuffer @@ -26,6 +26,8 @@ class IRToBoogie(var program: Program, var spec: Specification) { private val Gamma_mem = BMapVar("Gamma_mem", MapBType(BitVecBType(64), BoolBType), Scope.Global) private val stack = BMapVar("stack", MapBType(BitVecBType(64), BitVecBType(8)), Scope.Global) private val Gamma_stack = BMapVar("Gamma_stack", MapBType(BitVecBType(64), BoolBType), Scope.Global) + + private var config: BoogieGeneratorConfig = BoogieGeneratorConfig() private val modifiedCheck: Set[BVar] = (for (i <- 19 to 29) yield { Set(BVariable("R" + i, BitVecBType(64), Scope.Global), BVariable("Gamma_R" + i, BoolBType, Scope.Global)) }).flatten.toSet ++ Set( @@ -33,7 +35,8 @@ class IRToBoogie(var program: Program, var spec: Specification) { BVariable("Gamma_R" + 31, BoolBType, Scope.Global) ) - def translate(boogieGeneratorQuirks: BoogieGeneratorConfig): BProgram = { + def translate(boogieGeneratorConfig: BoogieGeneratorConfig): BProgram = { + config = boogieGeneratorConfig val readOnlyMemory = memoryToCondition(program.readOnlyMemory) val procedures = program.procedures.map(f => translateProcedure(f, readOnlyMemory)) val defaultGlobals = List(BVarDecl(mem), BVarDecl(Gamma_mem)) @@ -157,10 +160,15 @@ class IRToBoogie(var program: Program, var spec: Specification) { (indices(i), valuesEndian(i)) } - val body: MapUpdate = indiceValues.tail.foldLeft(MapUpdate(memVar, indices.head, valuesEndian.head)) { - (update: MapUpdate, next: (BExpr, BExpr)) => MapUpdate(update, next._1, next._2) + val body: BExpr = + config.memoryFunctionType match { + case BoogieMemoryAccessMode.SuccessiveStoreSelect => indiceValues.tail.foldLeft(MapUpdate(memVar, indices.head, valuesEndian.head)) { + (update: MapUpdate, next: (BExpr, BExpr)) => MapUpdate(update, next._1, next._2) + } + case BoogieMemoryAccessMode.LambdaStoreSelect => ??? } + BFunction(m.fnName, "", in, out, Some(body)) case g: GammaStoreOp => val gammaMapType = MapBType(BitVecBType(g.addressSize), BoolBType) @@ -184,10 +192,15 @@ class IRToBoogie(var program: Program, var spec: Specification) { (indices(i), values(i)) } - val body: MapUpdate = indiceValues.tail.foldLeft(MapUpdate(gammaMapVar, indices.head, values.head)) { - (update: MapUpdate, next: (BExpr, BExpr)) => MapUpdate(update, next._1, next._2) + val body: BExpr = config.memoryFunctionType match { + case BoogieMemoryAccessMode.SuccessiveStoreSelect => + indiceValues.tail.foldLeft(MapUpdate(gammaMapVar, indices.head, values.head)) { + (update: MapUpdate, next: (BExpr, BExpr)) => MapUpdate(update, next._1, next._2) + } + case BoogieMemoryAccessMode.LambdaStoreSelect => ??? } + BFunction(g.fnName, "", in, out, Some(body)) case l: LOp => val memoryVar = BParam("memory", l.memoryType) From d1b558c75f75eb43ab71fc5dead5de96aba74899 Mon Sep 17 00:00:00 2001 From: Nicholas Coughlin Date: Tue, 24 Oct 2023 11:13:12 +1000 Subject: [PATCH 09/20] Change memory updates > 8 bits to use lambdas --- src/main/scala/boogie/BExpr.scala | 62 ++++++++++ src/main/scala/boogie/BProgram.scala | 9 +- src/main/scala/translating/IRToBoogie.scala | 128 ++++++++++++++------ 3 files changed, 157 insertions(+), 42 deletions(-) diff --git a/src/main/scala/boogie/BExpr.scala b/src/main/scala/boogie/BExpr.scala index 1962ea3b3..d763b864c 100644 --- a/src/main/scala/boogie/BExpr.scala +++ b/src/main/scala/boogie/BExpr.scala @@ -403,12 +403,15 @@ trait QuantifierExpr(sort: Quantifier, bound: List[BVar], body: BExpr) extends B enum Quantifier { case forall case exists + case lambda } case class ForAll(bound: List[BVar], body: BExpr) extends QuantifierExpr(Quantifier.forall, bound, body) case class Exists(bound: List[BVar], body: BExpr) extends QuantifierExpr(Quantifier.exists, bound, body) +case class Lambda(bound: List[BVar], body: BExpr) extends QuantifierExpr(Quantifier.lambda, bound, body) + case class Old(body: BExpr) extends BExpr { override def toString: String = s"old($body)" override def getType: BType = body.getType @@ -468,6 +471,65 @@ case class GammaStoreOp(addressSize: Int, bits: Int, accesses: Int) extends Func } case class LOp(memoryType: BType, indexType: BType) extends FunctionOp +/** + * Utility to extract a particular byte from a bitvector. + */ +case class ByteExtract(valueSize: Int, offsetSize: Int) extends FunctionOp { + val fnName: String = s"byte_extract${valueSize}_${offsetSize}" +} + +case class BByteExtract(value: BExpr, offset: BExpr) extends BExpr { + override def toString: String = s"$fnName($value, $offset)" + + val valueSize: Int = value.getType match { + case b: BitVecBType => b.size + case _ => throw new Exception(s"ByteExtract does not have Bitvector type: $this") + } + + val offsetSize: Int = offset.getType match { + case b: BitVecBType => b.size + case _ => throw new Exception(s"ByteExtract does not have Bitvector type: $this") + } + + val fnName: String = s"byte_extract${valueSize}_${offsetSize}" + + override val getType: BType = BitVecBType(8) + override def functionOps: Set[FunctionOp] = + value.functionOps ++ offset.functionOps + ByteExtract(valueSize, offsetSize) + override def locals: Set[BVar] = value.locals ++ offset.locals + override def globals: Set[BVar] = value.globals ++ offset.globals + override def loads: Set[BExpr] = value.loads ++ offset.loads +} + +/** + * Utility to test if a particular value i is within the bounds of a base variable + * and some length. Factors in the problem of wrap around, given the base + length + * exceeds the bitvector size. + * + * Assumes all inputs are of the same bitvector width. + */ +case class InBounds(bits: Int) extends FunctionOp { + val fnName: String = s"in_bounds$bits" +} + +case class BInBounds(base: BExpr, len: BExpr, i: BExpr) extends BExpr { + override def toString: String = s"$fnName($base, $len, $i)" + + val baseSize: Int = base.getType match { + case b: BitVecBType => b.size + case _ => throw new Exception(s"InBounds does not have Bitvector type: $this") + } + + val fnName: String = s"in_bounds${baseSize}" + + override val getType: BType = BoolBType + override def functionOps: Set[FunctionOp] = + base.functionOps ++ len.functionOps ++ i.functionOps + InBounds(baseSize) + override def locals: Set[BVar] = base.locals ++ len.locals ++ i.locals + override def globals: Set[BVar] = base.globals ++ len.globals ++ i.globals + override def loads: Set[BExpr] = base.loads ++ len.loads ++ i.loads +} + case class BMemoryLoad(memory: BMapVar, index: BExpr, endian: Endian, bits: Int) extends BExpr { override def toString: String = s"$fnName($memory, $index)" diff --git a/src/main/scala/boogie/BProgram.scala b/src/main/scala/boogie/BProgram.scala index 98312ff32..891cdd4e5 100644 --- a/src/main/scala/boogie/BProgram.scala +++ b/src/main/scala/boogie/BProgram.scala @@ -64,7 +64,7 @@ case class BAxiom(body: BExpr) extends BDeclaration { override def toString: String = s"axiom $body;" } -case class BFunction(name: String, bvbuiltin: String, in: List[BVar], out: BVar, body: Option[BExpr]) +case class BFunction(name: String, bvbuiltin: String, in: List[BVar], out: BVar, body: Option[BExpr], inline: Boolean =false) extends BDeclaration with Ordered[BFunction] { override def compare(that: BFunction): Int = name.compare(that.name) @@ -74,8 +74,13 @@ case class BFunction(name: String, bvbuiltin: String, in: List[BVar], out: BVar, } else { s" {:bvbuiltin \"$bvbuiltin\"}" } + val inlineString = if (inline) { + s" {:inline}" + } else { + "" + } val inString = in.map(_.withType).mkString(", ") - val declString = s"function$bvbuiltinString $name($inString) returns (${out.withType})" + val declString = s"function$bvbuiltinString$inlineString $name($inString) returns (${out.withType})" body match { case Some(b) => List(declString + " {", " " + b.toString, "}", "") case None => List(declString + ";") diff --git a/src/main/scala/translating/IRToBoogie.scala b/src/main/scala/translating/IRToBoogie.scala index 783681451..9872081be 100644 --- a/src/main/scala/translating/IRToBoogie.scala +++ b/src/main/scala/translating/IRToBoogie.scala @@ -62,11 +62,15 @@ class IRToBoogie(var program: Program, var spec: Specification) { val rgProcs = genRely(relies, readOnlyMemory) :+ guaranteeReflexive + // TODO: Fixed point val functionsUsed1 = - procedures.flatMap(p => p.functionOps).toSet ++ rgProcs.flatMap(p => p.functionOps).toSet ++ directFunctions + procedures.flatMap(p => p.functionOps).toSet ++ + rgProcs.flatMap(p => p.functionOps).toSet ++ + directFunctions val functionsUsed2 = functionsUsed1.map(p => functionOpToDefinition(p)) val functionsUsed3 = functionsUsed2.flatMap(p => p.functionOps).map(p => functionOpToDefinition(p)) - val functionsUsed = (functionsUsed2 ++ functionsUsed3).toList.sorted + val functionsUsed4 = functionsUsed3.flatMap(p => p.functionOps).map(p => functionOpToDefinition(p)) + val functionsUsed = (functionsUsed2 ++ functionsUsed3 ++ functionsUsed4).toList.sorted val declarations = globalDecls ++ globalConsts ++ functionsUsed ++ pushUpModifiesFixedPoint(rgProcs ++ procedures) BProgram(declarations) @@ -142,33 +146,43 @@ class IRToBoogie(var program: Program, var spec: Specification) { val valueVar = BParam("value", BitVecBType(m.bits)) val in = List(memVar, indexVar, valueVar) val out = BParam(memType) - val indices: Seq[BExpr] = for (i <- 0 until m.accesses) yield { - if (i == 0) { - indexVar - } else { - BinaryBExpr(BVADD, indexVar, BitVecBLiteral(i, m.addressSize)) - } - } - val values: Seq[BExpr] = for (i <- 0 until m.accesses) yield { - BVExtract((i + 1) * m.valueSize, i * m.valueSize, valueVar) - } - val valuesEndian = m.endian match { - case Endian.BigEndian => values.reverse - case Endian.LittleEndian => values - } - val indiceValues = for (i <- 0 until m.accesses) yield { - (indices(i), valuesEndian(i)) - } + val body: BExpr = config.memoryFunctionType match { + case BoogieMemoryAccessMode.SuccessiveStoreSelect => { + val indices: Seq[BExpr] = for (i <- 0 until m.accesses) yield { + if (i == 0) { + indexVar + } else { + BinaryBExpr(BVADD, indexVar, BitVecBLiteral(i, m.addressSize)) + } + } + val values: Seq[BExpr] = for (i <- 0 until m.accesses) yield { + BVExtract((i + 1) * m.valueSize, i * m.valueSize, valueVar) + } + val valuesEndian = m.endian match { + case Endian.BigEndian => values.reverse + case Endian.LittleEndian => values + } + val indiceValues = for (i <- 0 until m.accesses) yield { + (indices(i), valuesEndian(i)) + } - val body: BExpr = - config.memoryFunctionType match { - case BoogieMemoryAccessMode.SuccessiveStoreSelect => indiceValues.tail.foldLeft(MapUpdate(memVar, indices.head, valuesEndian.head)) { + indiceValues.tail.foldLeft(MapUpdate(memVar, indices.head, valuesEndian.head)) { (update: MapUpdate, next: (BExpr, BExpr)) => MapUpdate(update, next._1, next._2) } - case BoogieMemoryAccessMode.LambdaStoreSelect => ??? + } + case BoogieMemoryAccessMode.LambdaStoreSelect => { + if m.accesses == 1 then + MapUpdate(memVar, indexVar, valueVar) + else { + val i = BVariable("i", BitVecBType(m.addressSize), Scope.Local) + Lambda(List(i), IfThenElse( + BInBounds(indexVar, BitVecBLiteral(m.accesses, m.addressSize), i), + BByteExtract(valueVar, BinaryBExpr(BVSUB, i, indexVar)), + MapAccess(memVar, i))) + } + } } - BFunction(m.fnName, "", in, out, Some(body)) case g: GammaStoreOp => val gammaMapType = MapBType(BitVecBType(g.addressSize), BoolBType) @@ -178,26 +192,36 @@ class IRToBoogie(var program: Program, var spec: Specification) { val in = List(gammaMapVar, indexVar, valueVar) val out = BParam(gammaMapType) - val indices: Seq[BExpr] = for (i <- 0 until g.accesses) yield { - if (i == 0) { - indexVar - } else { - BinaryBExpr(BVADD, indexVar, BitVecBLiteral(i, g.addressSize)) + val body : BExpr = config.memoryFunctionType match { + case BoogieMemoryAccessMode.LambdaStoreSelect => { + if g.accesses == 1 then + MapUpdate(gammaMapVar, indexVar, valueVar) + else { + val i = BVariable("i", BitVecBType(g.addressSize), Scope.Local) + Lambda(List(i), IfThenElse( + BInBounds(indexVar, BitVecBLiteral(g.accesses, g.addressSize), i), + valueVar, + MapAccess(gammaMapVar, i))) + } } - } - val values: Seq[BExpr] = for (i <- 0 until g.accesses) yield { - valueVar - } - val indiceValues = for (i <- 0 until g.accesses) yield { - (indices(i), values(i)) - } - - val body: BExpr = config.memoryFunctionType match { - case BoogieMemoryAccessMode.SuccessiveStoreSelect => + case BoogieMemoryAccessMode.SuccessiveStoreSelect => { + val indices: Seq[BExpr] = for (i <- 0 until g.accesses) yield { + if (i == 0) { + indexVar + } else { + BinaryBExpr(BVADD, indexVar, BitVecBLiteral(i, g.addressSize)) + } + } + val values: Seq[BExpr] = for (i <- 0 until g.accesses) yield { + valueVar + } + val indiceValues = for (i <- 0 until g.accesses) yield { + (indices(i), values(i)) + } indiceValues.tail.foldLeft(MapUpdate(gammaMapVar, indices.head, values.head)) { (update: MapUpdate, next: (BExpr, BExpr)) => MapUpdate(update, next._1, next._2) } - case BoogieMemoryAccessMode.LambdaStoreSelect => ??? + } } @@ -228,6 +252,30 @@ class IRToBoogie(var program: Program, var spec: Specification) { } } BFunction("L", "", List(memoryVar, indexVar), BParam(BoolBType), Some(body)) + case b: ByteExtract => + val valueVar = BParam("value", BitVecBType(b.valueSize)) + val offsetVar = BParam("offset", BitVecBType(b.offsetSize)) + val in = List(valueVar, offsetVar) + val out = BParam(BitVecBType(8)) + val shift = BinaryBExpr(BVMUL, offsetVar, BitVecBLiteral(8, b.offsetSize)) + val eshift = + if (b.valueSize < b.offsetSize) BVExtract(b.valueSize, 0, shift) + else if (b.valueSize == b.offsetSize) shift + else BVZeroExtend(b.valueSize - b.offsetSize, shift) + val body = BVExtract(8, 0, BinaryBExpr(BVLSHR, valueVar, eshift)) + BFunction(b.fnName, "", in, out, Some(body), true) + case b: InBounds => + val baseVar = BParam("base", BitVecBType(b.bits)) + val lenVar = BParam("len", BitVecBType(b.bits)) + val iVar = BParam("i", BitVecBType(b.bits)) + val in = List(baseVar, lenVar, iVar) + val out = BParam(BoolBType) + val end = BinaryBExpr(BVADD, baseVar, lenVar) + val above = BinaryBExpr(BVULE, baseVar, iVar) + val below = BinaryBExpr(BVULT, iVar, end) + val wrap = BinaryBExpr(BVULE, baseVar, end) + val body = IfThenElse(wrap, BinaryBExpr(BoolAND, above, below), BinaryBExpr(BoolOR, above, below)) + BFunction(b.fnName, "", in, out, Some(body), true) } } From 13a518602efbf89189ac7f481b2da3d8925a119f Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Tue, 24 Oct 2023 13:22:40 +1000 Subject: [PATCH 10/20] add lambda mem flag --- src/main/scala/Main.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/scala/Main.scala b/src/main/scala/Main.scala index 3ce075bd9..b83f06b3f 100644 --- a/src/main/scala/Main.scala +++ b/src/main/scala/Main.scala @@ -24,6 +24,8 @@ object Main { specFileName: Option[String], @arg(name = "output", short = 'o', doc = "Boogie output destination file.") outFileName: String = "basil-out", + @arg(name = "boogie-use-lambda-stores", doc = "Use lambda representation of store operations.") + lambdaStores: Flag, @arg(name = "verbose", short = 'v', doc = "Show extra debugging logs.") verbose: Flag, @arg(name = "analyse", doc = "Run static analysis pass.") @@ -61,7 +63,7 @@ object Main { loading = ILLoadingConfig(conf.adtFileName, conf.relfFileName, conf.specFileName, conf.dumpIL), runInterpret = conf.interpret.value, staticAnalysis = if (conf.analyse.value) then Some(StaticAnalysisConfig(conf.dumpIL)) else None, - boogieTranslation = BoogieGeneratorConfig(), + boogieTranslation = BoogieGeneratorConfig(if (conf.lambdaStores.value) then BoogieMemoryAccessMode.LambdaStoreSelect else BoogieMemoryAccessMode.SuccessiveStoreSelect), outputPrefix = conf.outFileName ) From a1b4d3719bb9eb2adc5d1f6d4ddb066690c4364c Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Tue, 24 Oct 2023 15:21:40 +1000 Subject: [PATCH 11/20] distinguish timeout from failure, add summary test --- src/test/scala/SystemTests.scala | 42 +++- src/test/summary.csv | 387 ------------------------------- 2 files changed, 33 insertions(+), 396 deletions(-) delete mode 100644 src/test/summary.csv diff --git a/src/test/scala/SystemTests.scala b/src/test/scala/SystemTests.scala index 3b4672b85..d6c7c61bb 100644 --- a/src/test/scala/SystemTests.scala +++ b/src/test/scala/SystemTests.scala @@ -11,15 +11,19 @@ import scala.sys.process.* * directory structure and file-name patterns. */ class SystemTests extends AnyFunSuite { + val testPath = "./src/test/" val correctPath = "./src/test/correct" val correctPrograms: Array[String] = getSubdirectories(correctPath) val incorrectPath = "./src/test/incorrect" val incorrectPrograms: Array[String] = getSubdirectories(incorrectPath) - case class TestResult(passed: Boolean, verified: Boolean, shouldVerify: Boolean, hasExpected: Boolean, matchesExpected: Boolean, translateTime: Long, verifyTime: Long) { - final val csvHeader = "passed,verified,shouldVerify,hasExpected,matchesExpected,translateTime,verifyTime" - val toCsv = s"$passed,$verified,$shouldVerify,$hasExpected,$matchesExpected,$translateTime,$verifyTime" + case class TestResult(passed: Boolean, verified: Boolean, shouldVerify: Boolean, hasExpected: Boolean, timedOut: Boolean, matchesExpected: Boolean, translateTime: Long, verifyTime: Long) { + val toCsv = s"$passed,$verified,$shouldVerify,$hasExpected,$timedOut,$matchesExpected,$translateTime,$verifyTime" + } + + object TestResult { + val csvHeader = "passed,verified,shouldVerify,hasExpected,timedOut,matchesExpected,translateTime,verifyTime" } val testResults: mutable.Map[String, TestResult] = mutable.HashMap() @@ -45,6 +49,27 @@ class SystemTests extends AnyFunSuite { ) } + test("summary") { + val csv: String = "testCase," + TestResult.csvHeader + System.lineSeparator() + testResults.map(r => s"${r._1},${r._2.toCsv}").mkString(System.lineSeparator()) + log(csv, testPath + "testResults.csv") + + val numVerified = testResults.count(_._2.verified) + val numNotVerified = testResults.count(!_._2.verified) + val numTimeout = testResults.count(_._2.timedOut) + val verifying = testResults.filter(x => !x._2.timedOut && x._2.verified).map(_._2.verifyTime) + val counterExamples = testResults.filter(x => !x._2.timedOut && !x._2.verified).map(_._2.verifyTime) + + info(s"Test summary: $numVerified verified, $numNotVerified failed to verify including $numTimeout timeouts.") + if (verifying.nonEmpty) + info(s"Average time to verify: ${verifying.sum / verifying.size}") + if (counterExamples.nonEmpty) + info(s"Average time to counterexample: ${counterExamples.sum/ counterExamples.size}") + + val summaryHeader = "verifiedCount,counterexampleCount,timeoutCount,verifyTotalTime,counterexampleTotalTime" + val summaryRow = s"$numVerified,${counterExamples.size},$numTimeout,${verifying.sum},${counterExamples.sum}" + log(summaryHeader + System.lineSeparator() + summaryRow, testPath + "summary.csv") + } + def runTest(path: String, name: String, variation: String, shouldVerify: Boolean): Unit= { val directoryPath = path + "/" + name + "/" @@ -57,17 +82,18 @@ class SystemTests extends AnyFunSuite { Logger.info(outPath) val timer = PerformanceTimer(s"test $name/$variation") if (File(specPath).exists) { - Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--spec", specPath, "--output", outPath, "--dump-il", ilPath)) + Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--spec", specPath, "--output", outPath, "--dump-il", ilPath, "--boogie-use-lambda-stores")) } else { - Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--output", outPath, "--dump-il", ilPath)) + Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--output", outPath, "--dump-il", ilPath, "--boogie-use-lambda-stores")) } val translateTime = timer.checkPoint("translate-boogie") Logger.info(outPath + " done") - val boogieResult = Seq("boogie", "/timeLimit:10", "/printVerifiedProceduresCount:0", "/useArrayAxioms", outPath).!! + val boogieResult = Seq("boogie", "/timeLimit:10", "/printVerifiedProceduresCount:0", outPath).!! val verifyTime = timer.checkPoint("verify") val resultPath = variationPath + "_result.txt" log(boogieResult, resultPath) val verified = boogieResult.strip().equals("Boogie program verifier finished with 0 errors") + val timedOut = boogieResult.strip() contains "timed out" val failureMsg = if shouldVerify then "Expected verification success, but got failure." else "Expected verification failure, but got success." @@ -84,10 +110,8 @@ class SystemTests extends AnyFunSuite { info("Note: this test has not previously succeeded") } val passed = verified == shouldVerify - val result = TestResult(passed, verified, shouldVerify, hasExpected, matchesExpected, translateTime, verifyTime) + val result = TestResult(passed, verified, shouldVerify, hasExpected, timedOut, matchesExpected, translateTime, verifyTime) testResults.put(s"$name/$variation", result) - val csv: String = "testCase," + result.csvHeader + System.lineSeparator() + testResults.map(r => s"${r._1},${r._2.toCsv}").mkString(System.lineSeparator()) - log(csv, testPath + "summary.csv") if (!passed) fail(failureMsg) } diff --git a/src/test/summary.csv b/src/test/summary.csv deleted file mode 100644 index 0e033cfea..000000000 --- a/src/test/summary.csv +++ /dev/null @@ -1,387 +0,0 @@ -testCase,passed,verified,shouldVerify,hasExpected,matchesExpected,translateTime,verifyTime -no_interference_update_y/clang,true,true,true,true,true,5,627 -basic_lock_read/gcc_no_plt_no_pic,true,true,true,true,true,9,582 -no_interference_update_x/gcc_no_plt_no_pic,true,true,true,true,true,4,599 -iflocal/clang_pic,true,false,false,true,true,7,532 -simple_jump/clang_O2,true,true,true,true,true,5,527 -malloc_with_local/gcc_pic,true,true,true,true,true,11,567 -basicassign_gamma0/gcc_O2,true,true,true,true,true,8,563 -switch/gcc_no_plt_no_pic,true,true,true,true,true,9,566 -basicassign1/clang_O2,true,false,false,true,true,3,550 -basic_assign_increment/gcc_pic,true,true,true,true,true,5,549 -function/clang,true,true,true,true,true,7,543 -basic_function_call_caller/gcc_pic,true,true,true,true,true,12,592 -basic_arrays_write/clang_O2,true,true,true,true,true,17,539 -basic_sec_policy_write/clang_O2,true,true,true,true,true,8,545 -initialisation/clang_no_plt_no_pic,true,true,true,true,true,6,582 -basic_arrays_write/gcc_no_plt_no_pic,true,true,true,true,true,5,593 -basic_lock_security_write/clang_O2,true,true,true,true,true,6,512 -switch2/clang_pic,false,false,true,false,true,9,808 -basic_lock_security_write/gcc,true,true,true,true,true,6,573 -secret_write/clang_pic,true,true,true,true,true,5,3366 -initialisation/gcc_no_plt_no_pic,true,true,true,true,true,10,544 -initialisation/clang_O2,true,true,true,true,true,4,567 -cjump/gcc,true,true,true,true,true,19,528 -switch/gcc_O2,true,true,true,true,true,3,504 -cjump/gcc_pic,true,true,true,true,true,5,553 -basic_sec_policy_write/clang,true,true,true,true,true,11,559 -using_gamma_write_z/gcc_pic,true,true,true,true,true,3,575 -basic_sec_policy_write/clang_no_plt_no_pic,true,true,true,true,true,5,549 -basic_lock_security_read/gcc_no_plt_no_pic,true,true,true,true,true,4,569 -switch2/clang_O2,true,true,true,true,true,3,537 -basic_lock_security_read/clang_no_plt_no_pic,true,true,true,true,true,6,579 -basic_lock_security_write/gcc_pic,true,true,true,true,true,9,576 -basicfree/clang_O2,true,true,true,true,true,4,497 -basic_function_call_reader/clang_pic,true,true,true,true,true,6,543 -functions_with_params/gcc_O2,true,true,true,true,true,4,522 -arrays_simple/gcc_O2,true,true,true,true,true,14,517 -basicassign_gamma0/gcc_no_plt_no_pic,true,true,true,true,true,10,591 -basic_assign_assign/clang_O2,true,true,true,true,true,7,522 -arrays_simple/gcc_pic,false,false,true,false,true,14,746 -no_interference_update_x/clang_pic,true,true,true,true,true,5,577 -basic_lock_security_read/gcc_O2,true,true,true,true,true,13,570 -ifbranches/gcc_pic,true,true,true,true,true,6,572 -multi_malloc/gcc,true,true,true,true,true,11,554 -syscall/gcc,true,true,true,true,true,6,541 -simple_jump/gcc_no_plt_no_pic,true,true,true,true,true,3,556 -no_interference_update_y/clang_O2,true,true,true,true,true,5,575 -basic_lock_unlock/gcc_pic,true,true,true,true,true,9,570 -arrays_simple/clang_O2,true,true,true,true,true,17,507 -basic_lock_security_read/gcc_pic,true,true,true,true,true,11,557 -basicassign2/gcc_O2,true,false,false,true,true,3,519 -ifglobal/clang_O2,true,true,true,true,true,13,528 -basicassign3/gcc_O2,true,false,false,true,true,7,572 -syscall/clang_no_plt_no_pic,true,true,true,true,true,5,539 -basic_operation_evaluation/clang_pic,true,true,true,true,true,5,568 -function1/gcc,true,true,true,true,true,5,561 -nestedif/gcc_O2,true,true,true,true,true,5,512 -using_gamma_conditional/clang_no_plt_no_pic,true,true,true,true,true,12,556 -jumptable2/gcc_O2,false,false,true,false,true,11,593 -malloc_with_local2/gcc_no_plt_no_pic,true,true,true,true,true,7,538 -basic_lock_read/clang_pic,true,true,true,true,true,5,549 -basicassign1/gcc_no_plt_no_pic,true,false,false,true,true,5,552 -using_gamma_write_z/gcc_O2,true,true,true,true,true,8,564 -malloc_with_local3/clang_pic,true,true,true,true,true,16,588 -switch2/gcc,true,true,true,true,true,11,655 -simple_jump/clang,true,true,true,true,true,4,556 -indirect_call/clang_no_plt_no_pic,false,false,true,false,true,10,588 -ifbranches/gcc_no_plt_no_pic,true,true,true,true,true,5,575 -basic_function_call_caller/gcc,true,true,true,true,true,6,598 -jumptable2/gcc_pic,false,false,true,false,true,10,600 -basicfree/gcc_no_plt_no_pic,true,true,true,true,true,5,527 -indirect_call/gcc_no_plt_no_pic,false,false,true,false,true,4,586 -basic_function_call_caller/gcc_O2,true,true,true,true,true,4,533 -basic_arrays_read/gcc_O2,true,true,true,true,true,11,511 -malloc_with_local3/clang,true,true,true,true,true,7,572 -ifglobal/gcc,true,true,true,true,true,10,541 -jumptable2/gcc_no_plt_no_pic,false,false,true,false,true,5,548 -basicfree/clang_no_plt_no_pic,true,true,true,true,true,7,534 -jumptable/clang_pic,false,false,true,false,true,4,591 -using_gamma_write_z/clang,true,true,true,true,true,4,537 -basic_sec_policy_write/gcc_pic,true,true,true,true,true,15,616 -basic_arrays_read/clang_O2,true,true,true,true,true,15,550 -basic_assign_increment/gcc_no_plt_no_pic,true,true,true,true,true,5,532 -basic_operation_evaluation/clang_no_plt_no_pic,true,true,true,true,true,7,559 -basic_loop_assign/clang_no_plt_no_pic,true,true,true,true,true,4,521 -basic_function_call_caller/clang,true,true,true,true,true,18,571 -secret_write/clang_O2,true,true,true,true,true,8,567 -jumptable3/gcc,true,true,true,true,true,15,653 -basic_lock_security_write/clang,true,true,true,true,true,9,540 -nestedifglobal/gcc,true,false,false,true,true,9,592 -secret_write/gcc_no_plt_no_pic,true,true,true,true,true,8,2471 -basic_function_call_reader/gcc_pic,true,true,true,true,true,11,587 -basic_sec_policy_read/clang,true,true,true,true,true,5,538 -simple_jump/gcc,true,true,true,true,true,3,545 -ifglobal/gcc_O2,true,true,true,true,true,11,540 -arrays_simple/gcc,false,false,true,false,true,23,728 -switch2/gcc_no_plt_no_pic,true,true,true,true,true,6,643 -nestedifglobal/gcc_pic,true,false,false,true,true,7,795 -syscall/clang_O2,false,false,true,false,true,7,539 -basic_function_call_reader/clang_O2,true,true,true,true,true,14,546 -syscall/gcc_pic,true,true,true,true,true,3,544 -basic_lock_read/clang_O2,true,true,true,true,true,6,542 -basic_sec_policy_read/gcc_pic,true,true,true,true,true,7,572 -function1/clang_pic,true,true,true,true,true,10,564 -basicassign_gamma0/clang,true,true,true,true,true,7,541 -basic_function_call_caller/clang_pic,true,true,true,true,true,17,593 -secret_write/gcc_O2,true,true,true,true,true,3,560 -basic_assign_assign/clang,true,true,true,true,true,21,513 -basicassign/gcc_no_plt_no_pic,true,false,false,true,true,7,974 -jumptable3/clang_no_plt_no_pic,false,false,true,false,true,5,703 -basic_lock_unlock/clang,true,true,true,true,true,6,545 -jumptable2/clang_pic,false,false,true,false,true,10,582 -basic_lock_security_read/clang,true,true,true,true,true,8,552 -nestedif/clang_pic,true,true,true,true,true,7,583 -basic_function_call_reader/gcc_no_plt_no_pic,true,true,true,true,true,8,578 -multi_malloc/gcc_O2,true,true,true,true,true,7,527 -secret_write/gcc,true,true,true,true,true,6,2418 -no_interference_update_y/gcc,true,true,true,true,true,6,568 -using_gamma_write_z/clang_O2,true,true,true,true,true,5,579 -nestedifglobal/clang,true,false,false,true,true,6,602 -basicassign1/gcc,true,false,false,true,true,9,582 -functionpointer/gcc_no_plt_no_pic,false,false,true,false,true,18,633 -basic_assign_increment/gcc_O2,true,true,true,true,true,9,532 -basicassign2/clang_O2,true,false,false,true,true,4,569 -basic_lock_security_read/gcc,true,true,true,true,true,7,545 -ifglobal/clang_pic,true,true,true,true,true,5,536 -basicassign_gamma0/clang_O2,true,true,true,true,true,3,534 -using_gamma_conditional/gcc,true,true,true,true,true,8,555 -malloc_with_local2/gcc_O2,true,true,true,true,true,10,548 -jumptable3/gcc_no_plt_no_pic,true,true,true,true,true,14,648 -initialisation/gcc,true,true,true,true,true,5,561 -basicassign_gamma0/gcc_pic,true,true,true,true,true,8,566 -basic_assign_assign/clang_no_plt_no_pic,true,true,true,true,true,9,572 -basic_sec_policy_write/gcc,true,true,true,true,true,20,577 -basic_assign_increment/clang,true,true,true,true,true,11,540 -jumptable2/gcc,false,false,true,false,true,9,591 -basicassign3/clang_pic,true,false,false,true,true,3,560 -function/gcc_pic,true,true,true,true,true,16,548 -iflocal/clang,true,false,false,true,true,7,543 -basic_loop_assign/clang,true,true,true,true,true,15,571 -basic_operation_evaluation/gcc,true,true,true,true,true,6,586 -basic_lock_unlock/gcc,true,true,true,true,true,9,548 -arrays_simple/clang_pic,true,true,true,true,true,10,523 -basicassign3/clang,true,false,false,true,true,6,562 -basicfree/gcc_pic,true,true,true,true,true,9,550 -using_gamma_conditional/clang_O2,true,true,true,true,true,8,545 -jumptable/gcc,false,false,true,false,true,6,618 -switch/clang,true,true,true,true,true,6,565 -jumptable3/gcc_O2,true,true,true,true,true,6,609 -basic_sec_policy_read/gcc_O2,true,true,true,true,true,16,540 -functions_with_params/clang_O2,true,true,true,true,true,3,528 -function1/clang_O2,true,true,true,true,true,9,530 -basicassign1/clang_no_plt_no_pic,true,false,false,true,true,3,608 -basic_operation_evaluation/gcc_O2,true,true,true,true,true,4,553 -basic_lock_read/clang_no_plt_no_pic,true,true,true,true,true,7,560 -basic_function_call_caller/clang_O2,true,true,true,true,true,21,537 -functions_with_params/clang_no_plt_no_pic,true,true,true,true,true,4,544 -indirect_call/clang_pic,false,false,true,false,true,14,591 -multi_malloc/clang_O2,true,true,true,true,true,6,540 -basicassign2/clang,true,false,false,true,true,4,604 -basic_loop_assign/clang_O2,true,true,true,true,true,6,535 -basicassign/clang_no_plt_no_pic,true,false,false,true,true,3,826 -basic_assign_assign/gcc_O2,true,true,true,true,true,7,542 -basic_arrays_write/gcc_O2,true,true,true,true,true,6,648 -malloc_with_local2/clang_no_plt_no_pic,true,true,true,true,true,13,560 -basicassign3/gcc,true,false,false,true,true,3,556 -basic_function_call_caller/clang_no_plt_no_pic,true,true,true,true,true,15,557 -basic_loop_assign/gcc_no_plt_no_pic,true,true,true,true,true,9,566 -switch2/clang_no_plt_no_pic,false,false,true,false,true,5,819 -basic_assign_assign/clang_pic,true,true,true,true,true,9,590 -basic_function_call_reader/clang_no_plt_no_pic,true,true,true,true,true,9,547 -ifbranches/gcc_O2,true,true,true,true,true,9,529 -basic_sec_policy_read/clang_O2,true,true,true,true,true,7,557 -malloc_with_local/gcc_O2,true,true,true,true,true,6,563 -arrays_simple/clang_no_plt_no_pic,true,true,true,true,true,23,518 -multi_malloc/clang,true,true,true,true,true,10,548 -no_interference_update_x/gcc,true,true,true,true,true,7,578 -nestedif/clang_no_plt_no_pic,true,true,true,true,true,7,562 -basic_arrays_write/clang_no_plt_no_pic,true,true,true,true,true,9,566 -ifglobal/gcc_pic,true,true,true,true,true,4,547 -functions_with_params/gcc_no_plt_no_pic,true,true,true,true,true,8,550 -basicassign2/gcc,true,false,false,true,true,6,575 -basicassign/gcc,true,false,false,true,true,6,1001 -ifbranches/clang_O2,true,true,true,true,true,3,527 -basic_lock_read/gcc_pic,true,true,true,true,true,7,545 -function1/gcc_O2,true,true,true,true,true,6,521 -syscall/clang_pic,true,true,true,true,true,4,555 -no_interference_update_x/clang_O2,true,true,true,true,true,8,572 -no_interference_update_y/gcc_no_plt_no_pic,true,true,true,true,true,5,584 -using_gamma_write_z/clang_no_plt_no_pic,true,true,true,true,true,4,538 -ifglobal/gcc_no_plt_no_pic,true,true,true,true,true,4,539 -functionpointer/gcc_O2,false,false,true,false,true,21,578 -nestedif/gcc,true,true,true,true,true,5,550 -indirect_call/gcc_O2,true,true,true,true,true,12,531 -basic_lock_unlock/clang_O2,true,true,true,true,true,7,522 -jumptable3/gcc_pic,true,true,true,true,true,15,672 -basic_lock_read/clang,true,true,true,true,true,9,551 -basicassign3/clang_no_plt_no_pic,true,false,false,true,true,8,561 -jumptable3/clang_O2,false,false,true,false,true,8,548 -basic_assign_increment/gcc,true,true,true,true,true,11,562 -nestedif/gcc_pic,true,true,true,true,true,4,549 -basic_lock_security_write/gcc_no_plt_no_pic,true,true,true,true,true,9,558 -nestedif/clang_O2,true,true,true,true,true,6,533 -basic_lock_unlock/clang_no_plt_no_pic,true,true,true,true,true,4,550 -secret_write/clang_no_plt_no_pic,true,true,true,true,true,6,913 -jumptable2/clang_no_plt_no_pic,false,false,true,false,true,8,583 -basic_assign_increment/clang_O2,true,true,true,true,true,9,525 -basic_arrays_read/gcc_pic,true,true,true,true,true,6,507 -malloc_with_local2/clang_O2,true,true,true,true,true,4,553 -functionpointer/gcc,false,false,true,false,true,9,661 -basicassign3/gcc_pic,true,false,false,true,true,8,587 -basic_lock_unlock/clang_pic,true,true,true,true,true,4,571 -functions_with_params/clang_pic,true,true,true,true,true,9,538 -syscall/gcc_no_plt_no_pic,true,true,true,true,true,4,522 -secret_write/gcc_pic,true,true,true,true,true,9,4440 -basicassign1/clang,true,false,false,true,true,4,570 -indirect_call/clang,false,false,true,false,true,8,617 -ifbranches/gcc,true,true,true,true,true,5,572 -basic_assign_increment/clang_no_plt_no_pic,true,true,true,true,true,7,520 -basic_operation_evaluation/clang,true,true,true,true,true,9,571 -function/gcc_no_plt_no_pic,true,true,true,true,true,22,527 -basic_sec_policy_write/clang_pic,true,true,true,true,true,4,562 -basic_lock_unlock/gcc_no_plt_no_pic,true,true,true,true,true,7,558 -basic_lock_security_read/clang_O2,true,true,true,true,true,5,528 -malloc_with_local3/gcc_O2,true,true,true,true,true,11,562 -nestedifglobal/gcc_no_plt_no_pic,true,false,false,true,true,9,596 -cjump/clang_pic,true,true,true,true,true,9,572 -basic_sec_policy_write/gcc_O2,true,true,true,true,true,6,560 -multi_malloc/clang_no_plt_no_pic,true,true,true,true,true,7,530 -initialisation/clang_pic,true,true,true,true,true,11,603 -basic_function_call_reader/gcc,true,true,true,true,true,5,561 -basicassign/gcc_O2,true,false,false,true,true,5,596 -jumptable/clang,false,false,true,false,true,6,588 -basic_lock_security_write/gcc_O2,true,true,true,true,true,7,547 -basicfree/clang,true,true,true,true,true,8,508 -basicfree/gcc_O2,true,true,true,true,true,6,502 -basic_loop_assign/gcc_O2,true,true,true,true,true,7,554 -initialisation/gcc_O2,true,true,true,true,true,9,532 -jumptable2/clang_O2,false,false,true,false,true,4,573 -jumptable/clang_O2,true,true,true,true,true,8,528 -using_gamma_conditional/clang_pic,true,true,true,true,true,9,583 -malloc_with_local/gcc,true,true,true,true,true,7,557 -basic_sec_policy_read/gcc,true,true,true,true,true,6,564 -simple_jump/clang_pic,true,true,true,true,true,4,539 -switch/gcc,true,true,true,true,true,3,555 -jumptable/gcc_O2,true,true,true,true,true,11,571 -no_interference_update_x/clang_no_plt_no_pic,true,true,true,true,true,6,567 -basicassign/gcc_pic,true,false,false,true,true,5,4080 -nestedifglobal/clang_pic,true,false,false,true,true,7,972 -basic_lock_security_write/clang_pic,true,true,true,true,true,6,546 -basic_arrays_write/gcc,true,true,true,true,true,6,604 -basic_lock_unlock/gcc_O2,true,true,true,true,true,8,542 -basic_sec_policy_read/clang_no_plt_no_pic,true,true,true,true,true,10,532 -syscall/clang,true,true,true,true,true,7,552 -switch/gcc_pic,true,true,true,true,true,5,537 -no_interference_update_y/clang_no_plt_no_pic,true,true,true,true,true,7,569 -no_interference_update_x/gcc_O2,true,true,true,true,true,3,567 -basicassign/clang_pic,true,false,false,true,true,5,2370 -basic_function_call_caller/gcc_no_plt_no_pic,true,true,true,true,true,25,628 -function1/clang_no_plt_no_pic,true,true,true,true,true,19,564 -basicassign2/clang_pic,true,false,false,true,true,7,595 -using_gamma_conditional/gcc_no_plt_no_pic,true,true,true,true,true,5,543 -multi_malloc/gcc_no_plt_no_pic,true,true,true,true,true,5,559 -cjump/clang_no_plt_no_pic,true,true,true,true,true,6,546 -functionpointer/gcc_pic,false,false,true,false,true,12,595 -iflocal/gcc,true,false,false,true,true,6,566 -ifglobal/clang_no_plt_no_pic,true,true,true,true,true,4,522 -iflocal/gcc_no_plt_no_pic,true,false,false,true,true,4,567 -malloc_with_local/gcc_no_plt_no_pic,true,true,true,true,true,8,570 -functionpointer/clang_O2,false,false,true,false,true,10,567 -malloc_with_local2/clang_pic,true,true,true,true,true,7,535 -basic_function_call_reader/gcc_O2,true,true,true,true,true,9,544 -simple_jump/gcc_pic,true,true,true,true,true,6,561 -malloc_with_local/clang,true,true,true,true,true,6,532 -basic_lock_read/gcc_O2,true,true,true,true,true,7,561 -malloc_with_local/clang_pic,true,true,true,true,true,7,560 -malloc_with_local2/clang,true,true,true,true,true,5,542 -iflocal/gcc_pic,true,false,false,true,true,6,557 -ifbranches/clang_no_plt_no_pic,true,true,true,true,true,6,592 -basic_arrays_write/clang_pic,true,true,true,true,true,5,578 -basic_sec_policy_read/gcc_no_plt_no_pic,true,true,true,true,true,9,548 -initialisation/clang,true,true,true,true,true,9,554 -functionpointer/clang_pic,false,false,true,false,true,12,618 -basic_assign_increment/clang_pic,true,true,true,true,true,11,569 -using_gamma_conditional/gcc_pic,true,true,true,true,true,4,536 -basic_loop_assign/gcc_pic,true,true,true,true,true,6,564 -syscall/gcc_O2,true,true,true,true,true,6,491 -cjump/gcc_no_plt_no_pic,true,true,true,true,true,7,531 -arrays_simple/clang,true,true,true,true,true,232,515 -jumptable3/clang_pic,false,false,true,false,true,10,678 -malloc_with_local3/gcc_pic,true,true,true,true,true,10,581 -function/gcc,true,true,true,true,true,13,522 -nestedifglobal/clang_no_plt_no_pic,true,false,false,true,true,7,613 -basic_loop_assign/gcc,true,true,true,true,true,7,563 -functionpointer/clang,false,false,true,false,true,16,615 -multi_malloc/gcc_pic,true,true,true,true,true,5,537 -basic_arrays_read/clang_no_plt_no_pic,true,true,true,true,true,12,539 -no_interference_update_x/gcc_pic,true,true,true,true,true,6,623 -basicfree/gcc,true,true,true,true,true,5,544 -basicassign1/clang_pic,true,false,false,true,true,5,582 -function1/gcc_no_plt_no_pic,true,true,true,true,true,6,551 -basicassign/clang,true,false,false,true,true,8,850 -basic_lock_security_write/clang_no_plt_no_pic,true,true,true,true,true,5,544 -functionpointer/clang_no_plt_no_pic,false,false,true,false,true,6,586 -using_gamma_conditional/gcc_O2,true,true,true,true,true,4,546 -function/clang_pic,true,true,true,true,true,6,572 -switch/clang_pic,true,true,true,true,true,4,575 -basic_arrays_read/gcc,true,true,true,true,true,13,538 -using_gamma_write_z/clang_pic,true,true,true,true,true,9,604 -basic_sec_policy_write/gcc_no_plt_no_pic,true,true,true,true,true,10,553 -basic_loop_assign/clang_pic,true,true,true,true,true,8,544 -switch2/clang,false,false,true,false,true,10,807 -nestedif/clang,true,true,true,true,true,5,577 -ifbranches/clang,true,true,true,true,true,8,599 -basicassign_gamma0/clang_no_plt_no_pic,true,true,true,true,true,3,535 -basic_assign_assign/gcc,true,true,true,true,true,5,512 -malloc_with_local3/clang_no_plt_no_pic,true,true,true,true,true,11,584 -switch/clang_no_plt_no_pic,true,true,true,true,true,4,556 -basic_arrays_read/clang,true,true,true,true,true,24,531 -basic_operation_evaluation/gcc_pic,true,true,true,true,true,6,558 -function/clang_no_plt_no_pic,true,true,true,true,true,4,545 -malloc_with_local/clang_O2,true,true,true,true,true,4,532 -simple_jump/clang_no_plt_no_pic,true,true,true,true,true,7,554 -indirect_call/gcc_pic,false,false,true,false,true,6,586 -using_gamma_write_z/gcc,true,true,true,true,true,9,591 -basicassign_gamma0/gcc,true,true,true,true,true,7,563 -function1/gcc_pic,true,true,true,true,true,10,535 -jumptable2/clang,false,false,true,false,true,4,563 -cjump/clang_O2,true,true,true,true,true,4,517 -using_gamma_conditional/clang,true,true,true,true,true,3,571 -basicassign2/gcc_pic,true,false,false,true,true,10,635 -switch2/gcc_O2,true,true,true,true,true,8,536 -no_interference_update_y/gcc_O2,true,true,true,true,true,5,654 -function1/clang,true,true,true,true,true,8,575 -ifglobal/clang,true,true,true,true,true,7,525 -malloc_with_local2/gcc,true,true,true,true,true,13,576 -functions_with_params/gcc,true,true,true,true,true,4,530 -basicassign1/gcc_O2,true,false,false,true,true,7,549 -nestedif/gcc_no_plt_no_pic,true,true,true,true,true,4,538 -multi_malloc/clang_pic,true,true,true,true,true,10,560 -jumptable/clang_no_plt_no_pic,false,false,true,false,true,11,629 -jumptable3/clang,false,false,true,false,true,13,717 -basic_lock_read/gcc,true,true,true,true,true,13,565 -functions_with_params/gcc_pic,true,true,true,true,true,9,544 -indirect_call/clang_O2,true,true,true,true,true,20,517 -jumptable/gcc_pic,false,false,true,false,true,11,626 -basicassign2/clang_no_plt_no_pic,true,false,false,true,true,5,598 -basicassign/clang_O2,true,false,false,true,true,4,568 -indirect_call/gcc,false,false,true,false,true,9,584 -ifbranches/clang_pic,true,true,true,true,true,4,594 -basic_arrays_write/clang,true,true,true,true,true,9,523 -basicassign_gamma0/clang_pic,true,true,true,true,true,13,583 -basicassign3/clang_O2,true,false,false,true,true,7,558 -basicassign1/gcc_pic,true,false,false,true,true,9,569 -basicfree/clang_pic,true,true,true,true,true,22,524 -basic_sec_policy_read/clang_pic,true,true,true,true,true,4,539 -function/clang_O2,true,true,true,true,true,4,510 -basicassign3/gcc_no_plt_no_pic,true,false,false,true,true,7,583 -function/gcc_O2,true,true,true,true,true,7,538 -basic_arrays_write/gcc_pic,true,true,true,true,true,6,580 -initialisation/gcc_pic,true,true,true,true,true,4,737 -basic_lock_security_read/clang_pic,true,true,true,true,true,8,578 -basicassign2/gcc_no_plt_no_pic,true,false,false,true,true,4,598 -basic_operation_evaluation/gcc_no_plt_no_pic,true,true,true,true,true,8,557 -no_interference_update_y/clang_pic,true,true,true,true,true,5,612 -basic_assign_assign/gcc_no_plt_no_pic,true,true,true,true,true,5,566 -malloc_with_local2/gcc_pic,true,true,true,true,true,6,564 -cjump/clang,true,true,true,true,true,5,534 -basic_operation_evaluation/clang_O2,true,true,true,true,true,4,501 -malloc_with_local3/gcc,true,true,true,true,true,11,580 -basic_assign_assign/gcc_pic,true,true,true,true,true,6,563 -basic_function_call_reader/clang,true,true,true,true,true,7,544 -secret_write/clang,true,true,true,true,true,11,964 -functions_with_params/clang,true,true,true,true,true,13,514 -switch2/gcc_pic,true,true,true,true,true,5,644 -malloc_with_local/clang_no_plt_no_pic,true,true,true,true,true,7,576 -iflocal/clang_no_plt_no_pic,true,false,false,true,true,6,564 -switch/clang_O2,true,true,true,true,true,7,509 -no_interference_update_y/gcc_pic,true,true,true,true,true,3,574 -no_interference_update_x/clang,true,true,true,true,true,3,588 -malloc_with_local3/gcc_no_plt_no_pic,true,true,true,true,true,6,578 -using_gamma_write_z/gcc_no_plt_no_pic,true,true,true,true,true,3,534 -malloc_with_local3/clang_O2,true,true,true,true,true,6,547 -basic_arrays_read/clang_pic,true,true,true,true,true,13,514 -basic_arrays_read/gcc_no_plt_no_pic,true,true,true,true,true,6,507 -cjump/gcc_O2,true,true,true,true,true,3,513 -simple_jump/gcc_O2,true,true,true,true,true,6,533 \ No newline at end of file From 277f167fe5596a430d8db105ae4f521860d35e5b Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Tue, 24 Oct 2023 15:23:33 +1000 Subject: [PATCH 12/20] update gitignore --- src/test/.gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/.gitignore b/src/test/.gitignore index 314f02b1b..3db4d7ebc 100644 --- a/src/test/.gitignore +++ b/src/test/.gitignore @@ -1 +1,2 @@ -*.txt \ No newline at end of file +*.txt +*.csv \ No newline at end of file From ff0049ac77aa7eff71f2dca09a8e9df61c894460 Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Tue, 24 Oct 2023 15:26:57 +1000 Subject: [PATCH 13/20] revert defaults --- src/test/scala/SystemTests.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/scala/SystemTests.scala b/src/test/scala/SystemTests.scala index d6c7c61bb..7a052e0d5 100644 --- a/src/test/scala/SystemTests.scala +++ b/src/test/scala/SystemTests.scala @@ -82,13 +82,13 @@ class SystemTests extends AnyFunSuite { Logger.info(outPath) val timer = PerformanceTimer(s"test $name/$variation") if (File(specPath).exists) { - Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--spec", specPath, "--output", outPath, "--dump-il", ilPath, "--boogie-use-lambda-stores")) + Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--spec", specPath, "--output", outPath, "--dump-il", ilPath)) } else { - Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--output", outPath, "--dump-il", ilPath, "--boogie-use-lambda-stores")) + Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--output", outPath, "--dump-il", ilPath)) } val translateTime = timer.checkPoint("translate-boogie") Logger.info(outPath + " done") - val boogieResult = Seq("boogie", "/timeLimit:10", "/printVerifiedProceduresCount:0", outPath).!! + val boogieResult = Seq("boogie", "/timeLimit:10", "/printVerifiedProceduresCount:0", "/useArrayAxioms", outPath).!! val verifyTime = timer.checkPoint("verify") val resultPath = variationPath + "_result.txt" log(boogieResult, resultPath) From 55b1911a82299d3bf76affc8fd528f8ac1f2eb2e Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Tue, 24 Oct 2023 17:17:43 +1000 Subject: [PATCH 14/20] add bigendian support for lambda stores --- src/main/scala/boogie/BExpr.scala | 11 +++++++---- src/main/scala/translating/IRToBoogie.scala | 17 ++++++++++++----- src/main/scala/util/BASILConfig.scala | 5 ----- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/main/scala/boogie/BExpr.scala b/src/main/scala/boogie/BExpr.scala index d763b864c..e720fc403 100644 --- a/src/main/scala/boogie/BExpr.scala +++ b/src/main/scala/boogie/BExpr.scala @@ -508,11 +508,14 @@ case class BByteExtract(value: BExpr, offset: BExpr) extends BExpr { * * Assumes all inputs are of the same bitvector width. */ -case class InBounds(bits: Int) extends FunctionOp { - val fnName: String = s"in_bounds$bits" +case class InBounds(bits: Int, endian: Endian) extends FunctionOp { + val fnName: String = endian match { + case Endian.LittleEndian => s"in_bounds${bits}_le" + case Endian.BigEndian=> s"in_bounds${bits}_be" + } } -case class BInBounds(base: BExpr, len: BExpr, i: BExpr) extends BExpr { +case class BInBounds(base: BExpr, len: BExpr, endian: Endian, i: BExpr) extends BExpr { override def toString: String = s"$fnName($base, $len, $i)" val baseSize: Int = base.getType match { @@ -524,7 +527,7 @@ case class BInBounds(base: BExpr, len: BExpr, i: BExpr) extends BExpr { override val getType: BType = BoolBType override def functionOps: Set[FunctionOp] = - base.functionOps ++ len.functionOps ++ i.functionOps + InBounds(baseSize) + base.functionOps ++ len.functionOps ++ i.functionOps + InBounds(baseSize, endian) override def locals: Set[BVar] = base.locals ++ len.locals ++ i.locals override def globals: Set[BVar] = base.globals ++ len.globals ++ i.globals override def loads: Set[BExpr] = base.loads ++ len.loads ++ i.loads diff --git a/src/main/scala/translating/IRToBoogie.scala b/src/main/scala/translating/IRToBoogie.scala index 9872081be..f2198178a 100644 --- a/src/main/scala/translating/IRToBoogie.scala +++ b/src/main/scala/translating/IRToBoogie.scala @@ -62,7 +62,6 @@ class IRToBoogie(var program: Program, var spec: Specification) { val rgProcs = genRely(relies, readOnlyMemory) :+ guaranteeReflexive - // TODO: Fixed point val functionsUsed1 = procedures.flatMap(p => p.functionOps).toSet ++ rgProcs.flatMap(p => p.functionOps).toSet ++ @@ -176,7 +175,7 @@ class IRToBoogie(var program: Program, var spec: Specification) { else { val i = BVariable("i", BitVecBType(m.addressSize), Scope.Local) Lambda(List(i), IfThenElse( - BInBounds(indexVar, BitVecBLiteral(m.accesses, m.addressSize), i), + BInBounds(indexVar, BitVecBLiteral(m.accesses, m.addressSize), m.endian, i), BByteExtract(valueVar, BinaryBExpr(BVSUB, i, indexVar)), MapAccess(memVar, i))) } @@ -199,7 +198,7 @@ class IRToBoogie(var program: Program, var spec: Specification) { else { val i = BVariable("i", BitVecBType(g.addressSize), Scope.Local) Lambda(List(i), IfThenElse( - BInBounds(indexVar, BitVecBLiteral(g.accesses, g.addressSize), i), + BInBounds(indexVar, BitVecBLiteral(g.accesses, g.addressSize), Endian.LittleEndian, i), valueVar, MapAccess(gammaMapVar, i))) } @@ -270,8 +269,16 @@ class IRToBoogie(var program: Program, var spec: Specification) { val iVar = BParam("i", BitVecBType(b.bits)) val in = List(baseVar, lenVar, iVar) val out = BParam(BoolBType) - val end = BinaryBExpr(BVADD, baseVar, lenVar) - val above = BinaryBExpr(BVULE, baseVar, iVar) + val begin = b.endian match { + case Endian.LittleEndian => baseVar + case Endian.BigEndian => BinaryBExpr(BVSUB, baseVar, lenVar) + } + val end = b.endian match { + case Endian.LittleEndian => BinaryBExpr(BVADD, baseVar, lenVar) + case Endian.BigEndian => baseVar + } + + val above = BinaryBExpr(BVULE, begin, iVar) val below = BinaryBExpr(BVULT, iVar, end) val wrap = BinaryBExpr(BVULE, baseVar, end) val body = IfThenElse(wrap, BinaryBExpr(BoolAND, above, below), BinaryBExpr(BoolOR, above, below)) diff --git a/src/main/scala/util/BASILConfig.scala b/src/main/scala/util/BASILConfig.scala index 2fadae26e..7b80888a1 100644 --- a/src/main/scala/util/BASILConfig.scala +++ b/src/main/scala/util/BASILConfig.scala @@ -1,10 +1,5 @@ package util -/** - * We use 'quirks' to manage the operation mode of the tool e.g. for a-b testing or compiler options. - */ - - case class ILLoadingConfig(adtFile: String, relfFile: String, specFile: Option[String], dumpIL: Option[String]) case class BoogieGeneratorConfig(memoryFunctionType: BoogieMemoryAccessMode = BoogieMemoryAccessMode.SuccessiveStoreSelect) case class StaticAnalysisConfig(dumpILToPath: Option[String] = None) From 1a358bcc3dfc4c174446e8811c9197903d30cee1 Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Wed, 25 Oct 2023 10:32:33 +1000 Subject: [PATCH 15/20] always consider timeout a failure --- src/test/scala/SystemTests.scala | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/test/scala/SystemTests.scala b/src/test/scala/SystemTests.scala index 7a052e0d5..bd33d1d2a 100644 --- a/src/test/scala/SystemTests.scala +++ b/src/test/scala/SystemTests.scala @@ -94,9 +94,13 @@ class SystemTests extends AnyFunSuite { log(boogieResult, resultPath) val verified = boogieResult.strip().equals("Boogie program verifier finished with 0 errors") val timedOut = boogieResult.strip() contains "timed out" - val failureMsg = - if shouldVerify then "Expected verification success, but got failure." - else "Expected verification failure, but got success." + + val failureMsg = (verified, shouldVerify, timedOut) match { + case (_, _, true) => "SMT solver timed out: unknown result" + case (true, false, false) => "Expected verification failure, but got success." + case (false, true, false) => "Expected verification success, but got failure." + case (_, _, false) => "Test passed" + } val expectedOutPath = variationPath + ".expected" val hasExpected = File(expectedOutPath).exists @@ -109,7 +113,7 @@ class SystemTests extends AnyFunSuite { } else { info("Note: this test has not previously succeeded") } - val passed = verified == shouldVerify + val passed = !timedOut && (verified == shouldVerify) val result = TestResult(passed, verified, shouldVerify, hasExpected, timedOut, matchesExpected, translateTime, verifyTime) testResults.put(s"$name/$variation", result) if (!passed) fail(failureMsg) From 7370c6a871affddf8ed8da29017522db62ba8ef6 Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Wed, 1 Nov 2023 13:32:00 +1000 Subject: [PATCH 16/20] use list for results --- src/test/scala/SystemTests.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/scala/SystemTests.scala b/src/test/scala/SystemTests.scala index bd33d1d2a..c9ed4713a 100644 --- a/src/test/scala/SystemTests.scala +++ b/src/test/scala/SystemTests.scala @@ -26,7 +26,7 @@ class SystemTests extends AnyFunSuite { val csvHeader = "passed,verified,shouldVerify,hasExpected,timedOut,matchesExpected,translateTime,verifyTime" } - val testResults: mutable.Map[String, TestResult] = mutable.HashMap() + val testResults: mutable.ArrayBuffer[(String, TestResult)] = mutable.ArrayBuffer() // get all variations of each program for (p <- correctPrograms) { @@ -115,7 +115,7 @@ class SystemTests extends AnyFunSuite { } val passed = !timedOut && (verified == shouldVerify) val result = TestResult(passed, verified, shouldVerify, hasExpected, timedOut, matchesExpected, translateTime, verifyTime) - testResults.put(s"$name/$variation", result) + testResults.append((s"$name/$variation", result)) if (!passed) fail(failureMsg) } From 71624fb743a8f84303ac7272b5d760bd1f411bd7 Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Wed, 1 Nov 2023 13:34:45 +1000 Subject: [PATCH 17/20] do not output IL.expected --- build.sbt | 5 ----- src/test/scala/SystemTests.scala | 5 ++--- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/build.sbt b/build.sbt index a384a5a01..ed7059c4a 100644 --- a/build.sbt +++ b/build.sbt @@ -45,8 +45,6 @@ updateExpected := { val name = e.getName val outPath = v / (name + ".bpl") val expectedPath = v / (name + ".expected") - val ILOutPath = v / (name + "-before-analysis.il") - val ILExpectedPath = v / (name + "-before-analysis.il.expected") val resultPath = v / (name + "_result.txt") if (resultPath.exists()) { val result = IO.read(resultPath) @@ -55,9 +53,6 @@ updateExpected := { if (outPath.exists() && !(expectedPath.exists() && filesContentEqual(outPath, expectedPath))) { IO.copyFile(outPath, expectedPath) } - if (ILOutPath.exists() && !(ILExpectedPath.exists() && filesContentEqual(ILExpectedPath, ILOutPath))) { - IO.copyFile(ILOutPath, ILExpectedPath) - } } } } diff --git a/src/test/scala/SystemTests.scala b/src/test/scala/SystemTests.scala index c9ed4713a..8d746ca4d 100644 --- a/src/test/scala/SystemTests.scala +++ b/src/test/scala/SystemTests.scala @@ -76,15 +76,14 @@ class SystemTests extends AnyFunSuite { val variationPath = directoryPath + variation + "/" + name val specPath = directoryPath + name + ".spec" val outPath = variationPath + ".bpl" - val ilPath = variationPath val ADTPath = variationPath + ".adt" val RELFPath = variationPath + ".relf" Logger.info(outPath) val timer = PerformanceTimer(s"test $name/$variation") if (File(specPath).exists) { - Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--spec", specPath, "--output", outPath, "--dump-il", ilPath)) + Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--spec", specPath, "--output", outPath)) } else { - Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--output", outPath, "--dump-il", ilPath)) + Main.main(Array("--adt", ADTPath, "--relf", RELFPath, "--output", outPath)) } val translateTime = timer.checkPoint("translate-boogie") Logger.info(outPath + " done") From 51d94f767a9de9b7373b6966f2c914c54467d81e Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Wed, 1 Nov 2023 13:35:47 +1000 Subject: [PATCH 18/20] remove il.expected files --- .../arrays_simple-before-analysis.il.expected | 310 ------ .../arrays_simple-before-analysis.il.expected | 302 ------ .../arrays_simple-before-analysis.il.expected | 310 ------ .../arrays_simple-before-analysis.il.expected | 310 ------ .../arrays_simple-before-analysis.il.expected | 302 ------ ...ic_arrays_read-before-analysis.il.expected | 307 ------ ...ic_arrays_read-before-analysis.il.expected | 304 ------ ...ic_arrays_read-before-analysis.il.expected | 307 ------ ...ic_arrays_read-before-analysis.il.expected | 308 ------ ...ic_arrays_read-before-analysis.il.expected | 307 ------ ...ic_arrays_read-before-analysis.il.expected | 304 ------ ...ic_arrays_read-before-analysis.il.expected | 307 ------ ...ic_arrays_read-before-analysis.il.expected | 307 ------ ...c_arrays_write-before-analysis.il.expected | 309 ------ ...c_arrays_write-before-analysis.il.expected | 305 ------ ...c_arrays_write-before-analysis.il.expected | 309 ------ ...c_arrays_write-before-analysis.il.expected | 309 ------ ...c_arrays_write-before-analysis.il.expected | 309 ------ ...c_arrays_write-before-analysis.il.expected | 305 ------ ...c_arrays_write-before-analysis.il.expected | 309 ------ ...c_arrays_write-before-analysis.il.expected | 309 ------ ..._assign_assign-before-analysis.il.expected | 305 ------ ..._assign_assign-before-analysis.il.expected | 305 ------ ..._assign_assign-before-analysis.il.expected | 305 ------ ..._assign_assign-before-analysis.il.expected | 306 ------ ..._assign_assign-before-analysis.il.expected | 306 ------ ..._assign_assign-before-analysis.il.expected | 305 ------ ..._assign_assign-before-analysis.il.expected | 306 ------ ..._assign_assign-before-analysis.il.expected | 306 ------ ...sign_increment-before-analysis.il.expected | 306 ------ ...sign_increment-before-analysis.il.expected | 306 ------ ...sign_increment-before-analysis.il.expected | 306 ------ ...sign_increment-before-analysis.il.expected | 307 ------ ...sign_increment-before-analysis.il.expected | 309 ------ ...sign_increment-before-analysis.il.expected | 306 ------ ...sign_increment-before-analysis.il.expected | 309 ------ ...sign_increment-before-analysis.il.expected | 309 ------ ...on_call_caller-before-analysis.il.expected | 335 ------- ...on_call_caller-before-analysis.il.expected | 317 ------- ...on_call_caller-before-analysis.il.expected | 335 ------- ...on_call_caller-before-analysis.il.expected | 337 ------- ...on_call_caller-before-analysis.il.expected | 337 ------- ...on_call_caller-before-analysis.il.expected | 317 ------- ...on_call_caller-before-analysis.il.expected | 337 ------- ...on_call_caller-before-analysis.il.expected | 337 ------- ...on_call_reader-before-analysis.il.expected | 372 -------- ...on_call_reader-before-analysis.il.expected | 334 ------- ...on_call_reader-before-analysis.il.expected | 372 -------- ...on_call_reader-before-analysis.il.expected | 374 -------- ...on_call_reader-before-analysis.il.expected | 339 ------- ...on_call_reader-before-analysis.il.expected | 320 ------- ...on_call_reader-before-analysis.il.expected | 339 ------- ...on_call_reader-before-analysis.il.expected | 339 ------- ...asic_lock_read-before-analysis.il.expected | 364 ------- ...asic_lock_read-before-analysis.il.expected | 322 ------- ...asic_lock_read-before-analysis.il.expected | 364 ------- ...asic_lock_read-before-analysis.il.expected | 366 ------- ...asic_lock_read-before-analysis.il.expected | 335 ------- ...asic_lock_read-before-analysis.il.expected | 321 ------- ...asic_lock_read-before-analysis.il.expected | 335 ------- ...asic_lock_read-before-analysis.il.expected | 335 ------- ..._security_read-before-analysis.il.expected | 363 ------- ..._security_read-before-analysis.il.expected | 334 ------- ..._security_read-before-analysis.il.expected | 363 ------- ..._security_read-before-analysis.il.expected | 365 ------- ..._security_read-before-analysis.il.expected | 332 ------- ..._security_read-before-analysis.il.expected | 321 ------- ..._security_read-before-analysis.il.expected | 332 ------- ..._security_read-before-analysis.il.expected | 332 ------- ...security_write-before-analysis.il.expected | 313 ------ ...security_write-before-analysis.il.expected | 306 ------ ...security_write-before-analysis.il.expected | 313 ------ ...security_write-before-analysis.il.expected | 315 ------ ...security_write-before-analysis.il.expected | 319 ------- ...security_write-before-analysis.il.expected | 306 ------ ...security_write-before-analysis.il.expected | 319 ------- ...security_write-before-analysis.il.expected | 319 ------- ...ic_lock_unlock-before-analysis.il.expected | 307 ------ ...ic_lock_unlock-before-analysis.il.expected | 307 ------ ...ic_lock_unlock-before-analysis.il.expected | 307 ------ ...ic_lock_unlock-before-analysis.il.expected | 309 ------ ...ic_lock_unlock-before-analysis.il.expected | 309 ------ ...ic_lock_unlock-before-analysis.il.expected | 307 ------ ...ic_lock_unlock-before-analysis.il.expected | 309 ------ ...ic_lock_unlock-before-analysis.il.expected | 309 ------ ...ic_loop_assign-before-analysis.il.expected | 305 ------ ...ic_loop_assign-before-analysis.il.expected | 305 ------ ...ic_loop_assign-before-analysis.il.expected | 305 ------ ...ic_loop_assign-before-analysis.il.expected | 306 ------ ...ic_loop_assign-before-analysis.il.expected | 306 ------ ...ic_loop_assign-before-analysis.il.expected | 305 ------ ...ic_loop_assign-before-analysis.il.expected | 306 ------ ...ic_loop_assign-before-analysis.il.expected | 306 ------ ...ion_evaluation-before-analysis.il.expected | 359 ------- ...ion_evaluation-before-analysis.il.expected | 302 ------ ...ion_evaluation-before-analysis.il.expected | 359 ------- ...ion_evaluation-before-analysis.il.expected | 359 ------- ...ion_evaluation-before-analysis.il.expected | 352 ------- ...ion_evaluation-before-analysis.il.expected | 302 ------ ...ion_evaluation-before-analysis.il.expected | 352 ------- ...ion_evaluation-before-analysis.il.expected | 352 ------- ...ec_policy_read-before-analysis.il.expected | 363 ------- ...ec_policy_read-before-analysis.il.expected | 334 ------- ...ec_policy_read-before-analysis.il.expected | 363 ------- ...ec_policy_read-before-analysis.il.expected | 365 ------- ...ec_policy_read-before-analysis.il.expected | 332 ------- ...ec_policy_read-before-analysis.il.expected | 321 ------- ...ec_policy_read-before-analysis.il.expected | 332 ------- ...ec_policy_read-before-analysis.il.expected | 332 ------- ...c_policy_write-before-analysis.il.expected | 314 ------ ...c_policy_write-before-analysis.il.expected | 307 ------ ...c_policy_write-before-analysis.il.expected | 314 ------ ...c_policy_write-before-analysis.il.expected | 316 ------- ...c_policy_write-before-analysis.il.expected | 320 ------- ...c_policy_write-before-analysis.il.expected | 307 ------ ...c_policy_write-before-analysis.il.expected | 320 ------- ...c_policy_write-before-analysis.il.expected | 320 ------- ...cassign_gamma0-before-analysis.il.expected | 306 ------ ...cassign_gamma0-before-analysis.il.expected | 306 ------ ...cassign_gamma0-before-analysis.il.expected | 306 ------ ...cassign_gamma0-before-analysis.il.expected | 308 ------ ...cassign_gamma0-before-analysis.il.expected | 308 ------ ...cassign_gamma0-before-analysis.il.expected | 306 ------ ...cassign_gamma0-before-analysis.il.expected | 308 ------ ...cassign_gamma0-before-analysis.il.expected | 308 ------ .../basicfree-before-analysis.il.expected | 336 ------- .../basicfree-before-analysis.il.expected | 301 ------ .../basicfree-before-analysis.il.expected | 336 ------- .../basicfree-before-analysis.il.expected | 336 ------- .../gcc/basicfree-before-analysis.il.expected | 335 ------- .../basicfree-before-analysis.il.expected | 301 ------ .../basicfree-before-analysis.il.expected | 335 ------- .../basicfree-before-analysis.il.expected | 335 ------- .../clang/cjump-before-analysis.il.expected | 374 -------- .../cjump-before-analysis.il.expected | 308 ------ .../cjump-before-analysis.il.expected | 374 -------- .../cjump-before-analysis.il.expected | 377 -------- .../gcc/cjump-before-analysis.il.expected | 344 ------- .../gcc_O2/cjump-before-analysis.il.expected | 308 ------ .../cjump-before-analysis.il.expected | 344 ------- .../gcc_pic/cjump-before-analysis.il.expected | 344 ------- .../function-before-analysis.il.expected | 333 ------- .../function-before-analysis.il.expected | 318 ------- .../function-before-analysis.il.expected | 333 ------- .../function-before-analysis.il.expected | 335 ------- .../gcc/function-before-analysis.il.expected | 336 ------- .../function-before-analysis.il.expected | 318 ------- .../function-before-analysis.il.expected | 336 ------- .../function-before-analysis.il.expected | 336 ------- .../function1-before-analysis.il.expected | 361 ------- .../function1-before-analysis.il.expected | 342 ------- .../function1-before-analysis.il.expected | 361 ------- .../function1-before-analysis.il.expected | 363 ------- .../gcc/function1-before-analysis.il.expected | 367 ------- .../function1-before-analysis.il.expected | 340 ------- .../function1-before-analysis.il.expected | 367 ------- .../function1-before-analysis.il.expected | 367 ------- ...ns_with_params-before-analysis.il.expected | 339 ------- ...ns_with_params-before-analysis.il.expected | 312 ------ ...ns_with_params-before-analysis.il.expected | 339 ------- ...ns_with_params-before-analysis.il.expected | 339 ------- ...ns_with_params-before-analysis.il.expected | 338 ------- ...ns_with_params-before-analysis.il.expected | 312 ------ ...ns_with_params-before-analysis.il.expected | 338 ------- ...ns_with_params-before-analysis.il.expected | 338 ------- .../ifbranches-before-analysis.il.expected | 375 -------- .../ifbranches-before-analysis.il.expected | 331 ------- .../ifbranches-before-analysis.il.expected | 375 -------- .../ifbranches-before-analysis.il.expected | 375 -------- .../ifbranches-before-analysis.il.expected | 342 ------- .../ifbranches-before-analysis.il.expected | 331 ------- .../ifbranches-before-analysis.il.expected | 342 ------- .../ifbranches-before-analysis.il.expected | 342 ------- .../ifglobal-before-analysis.il.expected | 362 ------- .../ifglobal-before-analysis.il.expected | 322 ------- .../ifglobal-before-analysis.il.expected | 362 ------- .../ifglobal-before-analysis.il.expected | 364 ------- .../gcc/ifglobal-before-analysis.il.expected | 329 ------- .../ifglobal-before-analysis.il.expected | 321 ------- .../ifglobal-before-analysis.il.expected | 329 ------- .../ifglobal-before-analysis.il.expected | 329 ------- .../indirect_call-before-analysis.il.expected | 343 ------- .../indirect_call-before-analysis.il.expected | 341 ------- ...initialisation-before-analysis.il.expected | 325 ------- ...initialisation-before-analysis.il.expected | 319 ------- ...initialisation-before-analysis.il.expected | 325 ------- ...initialisation-before-analysis.il.expected | 327 ------- ...initialisation-before-analysis.il.expected | 331 ------- ...initialisation-before-analysis.il.expected | 316 ------- ...initialisation-before-analysis.il.expected | 331 ------- ...initialisation-before-analysis.il.expected | 331 ------- .../jumptable-before-analysis.il.expected | 345 ------- .../jumptable-before-analysis.il.expected | 373 -------- .../jumptable3-before-analysis.il.expected | 893 ------------------ .../jumptable3-before-analysis.il.expected | 636 ------------- .../jumptable3-before-analysis.il.expected | 893 ------------------ .../jumptable3-before-analysis.il.expected | 893 ------------------ ...loc_with_local-before-analysis.il.expected | 401 -------- ...loc_with_local-before-analysis.il.expected | 345 ------- ...loc_with_local-before-analysis.il.expected | 401 -------- ...loc_with_local-before-analysis.il.expected | 401 -------- ...loc_with_local-before-analysis.il.expected | 399 -------- ...loc_with_local-before-analysis.il.expected | 348 ------- ...loc_with_local-before-analysis.il.expected | 399 -------- ...loc_with_local-before-analysis.il.expected | 399 -------- ...oc_with_local2-before-analysis.il.expected | 417 -------- ...oc_with_local2-before-analysis.il.expected | 345 ------- ...oc_with_local2-before-analysis.il.expected | 417 -------- ...oc_with_local2-before-analysis.il.expected | 417 -------- ...oc_with_local2-before-analysis.il.expected | 413 -------- ...oc_with_local2-before-analysis.il.expected | 348 ------- ...oc_with_local2-before-analysis.il.expected | 413 -------- ...oc_with_local2-before-analysis.il.expected | 413 -------- ...oc_with_local3-before-analysis.il.expected | 449 --------- ...oc_with_local3-before-analysis.il.expected | 361 ------- ...oc_with_local3-before-analysis.il.expected | 449 --------- ...oc_with_local3-before-analysis.il.expected | 449 --------- ...oc_with_local3-before-analysis.il.expected | 446 --------- ...oc_with_local3-before-analysis.il.expected | 388 -------- ...oc_with_local3-before-analysis.il.expected | 446 --------- ...oc_with_local3-before-analysis.il.expected | 446 --------- .../multi_malloc-before-analysis.il.expected | 388 -------- .../multi_malloc-before-analysis.il.expected | 334 ------- .../multi_malloc-before-analysis.il.expected | 388 -------- .../multi_malloc-before-analysis.il.expected | 388 -------- .../multi_malloc-before-analysis.il.expected | 386 -------- .../multi_malloc-before-analysis.il.expected | 336 ------- .../multi_malloc-before-analysis.il.expected | 386 -------- .../multi_malloc-before-analysis.il.expected | 386 -------- .../nestedif-before-analysis.il.expected | 487 ---------- .../nestedif-before-analysis.il.expected | 302 ------ .../nestedif-before-analysis.il.expected | 487 ---------- .../nestedif-before-analysis.il.expected | 487 ---------- .../gcc/nestedif-before-analysis.il.expected | 376 -------- .../nestedif-before-analysis.il.expected | 302 ------ .../nestedif-before-analysis.il.expected | 376 -------- .../nestedif-before-analysis.il.expected | 376 -------- ...rence_update_x-before-analysis.il.expected | 305 ------ ...rence_update_x-before-analysis.il.expected | 305 ------ ...rence_update_x-before-analysis.il.expected | 305 ------ ...rence_update_x-before-analysis.il.expected | 306 ------ ...rence_update_x-before-analysis.il.expected | 306 ------ ...rence_update_x-before-analysis.il.expected | 305 ------ ...rence_update_x-before-analysis.il.expected | 306 ------ ...rence_update_x-before-analysis.il.expected | 306 ------ ...rence_update_y-before-analysis.il.expected | 305 ------ ...rence_update_y-before-analysis.il.expected | 305 ------ ...rence_update_y-before-analysis.il.expected | 305 ------ ...rence_update_y-before-analysis.il.expected | 306 ------ ...rence_update_y-before-analysis.il.expected | 306 ------ ...rence_update_y-before-analysis.il.expected | 305 ------ ...rence_update_y-before-analysis.il.expected | 306 ------ ...rence_update_y-before-analysis.il.expected | 306 ------ .../secret_write-before-analysis.il.expected | 315 ------ .../secret_write-before-analysis.il.expected | 307 ------ .../secret_write-before-analysis.il.expected | 315 ------ .../secret_write-before-analysis.il.expected | 318 ------- .../secret_write-before-analysis.il.expected | 328 ------- .../secret_write-before-analysis.il.expected | 307 ------ .../secret_write-before-analysis.il.expected | 328 ------- .../secret_write-before-analysis.il.expected | 328 ------- .../simple_jump-before-analysis.il.expected | 362 ------- .../simple_jump-before-analysis.il.expected | 302 ------ .../simple_jump-before-analysis.il.expected | 362 ------- .../simple_jump-before-analysis.il.expected | 362 ------- .../simple_jump-before-analysis.il.expected | 329 ------- .../simple_jump-before-analysis.il.expected | 302 ------ .../simple_jump-before-analysis.il.expected | 329 ------- .../simple_jump-before-analysis.il.expected | 329 ------- .../clang/switch-before-analysis.il.expected | 426 --------- .../switch-before-analysis.il.expected | 301 ------ .../switch-before-analysis.il.expected | 426 --------- .../switch-before-analysis.il.expected | 426 --------- .../gcc/switch-before-analysis.il.expected | 361 ------- .../gcc_O2/switch-before-analysis.il.expected | 301 ------ .../switch-before-analysis.il.expected | 361 ------- .../switch-before-analysis.il.expected | 361 ------- .../switch2-before-analysis.il.expected | 311 ------ .../gcc/switch2-before-analysis.il.expected | 502 ---------- .../switch2-before-analysis.il.expected | 311 ------ .../switch2-before-analysis.il.expected | 502 ---------- .../switch2-before-analysis.il.expected | 502 ---------- .../clang/syscall-before-analysis.il.expected | 325 ------- .../syscall-before-analysis.il.expected | 325 ------- .../syscall-before-analysis.il.expected | 325 ------- .../gcc/syscall-before-analysis.il.expected | 323 ------- .../syscall-before-analysis.il.expected | 294 ------ .../syscall-before-analysis.il.expected | 323 ------- .../syscall-before-analysis.il.expected | 323 ------- ...ma_conditional-before-analysis.il.expected | 369 -------- ...ma_conditional-before-analysis.il.expected | 332 ------- ...ma_conditional-before-analysis.il.expected | 369 -------- ...ma_conditional-before-analysis.il.expected | 370 -------- ...ma_conditional-before-analysis.il.expected | 333 ------- ...ma_conditional-before-analysis.il.expected | 332 ------- ...ma_conditional-before-analysis.il.expected | 333 ------- ...ma_conditional-before-analysis.il.expected | 333 ------- ..._gamma_write_z-before-analysis.il.expected | 305 ------ ..._gamma_write_z-before-analysis.il.expected | 305 ------ ..._gamma_write_z-before-analysis.il.expected | 305 ------ ..._gamma_write_z-before-analysis.il.expected | 306 ------ ..._gamma_write_z-before-analysis.il.expected | 306 ------ ..._gamma_write_z-before-analysis.il.expected | 305 ------ ..._gamma_write_z-before-analysis.il.expected | 306 ------ ..._gamma_write_z-before-analysis.il.expected | 306 ------ .../basicassign-before-analysis.il.expected | 314 ------ .../basicassign-before-analysis.il.expected | 308 ------ .../basicassign-before-analysis.il.expected | 314 ------ .../basicassign-before-analysis.il.expected | 317 ------- .../basicassign-before-analysis.il.expected | 329 ------- .../basicassign-before-analysis.il.expected | 308 ------ .../basicassign-before-analysis.il.expected | 329 ------- .../basicassign-before-analysis.il.expected | 329 ------- .../basicassign1-before-analysis.il.expected | 315 ------ .../basicassign1-before-analysis.il.expected | 306 ------ .../basicassign1-before-analysis.il.expected | 315 ------ .../basicassign1-before-analysis.il.expected | 317 ------- .../basicassign1-before-analysis.il.expected | 321 ------- .../basicassign1-before-analysis.il.expected | 306 ------ .../basicassign1-before-analysis.il.expected | 321 ------- .../basicassign1-before-analysis.il.expected | 321 ------- .../basicassign2-before-analysis.il.expected | 315 ------ .../basicassign2-before-analysis.il.expected | 306 ------ .../basicassign2-before-analysis.il.expected | 315 ------ .../basicassign2-before-analysis.il.expected | 317 ------- .../basicassign2-before-analysis.il.expected | 321 ------- .../basicassign2-before-analysis.il.expected | 306 ------ .../basicassign2-before-analysis.il.expected | 321 ------- .../basicassign2-before-analysis.il.expected | 321 ------- .../basicassign3-before-analysis.il.expected | 315 ------ .../basicassign3-before-analysis.il.expected | 306 ------ .../basicassign3-before-analysis.il.expected | 315 ------ .../basicassign3-before-analysis.il.expected | 317 ------- .../basicassign3-before-analysis.il.expected | 321 ------- .../basicassign3-before-analysis.il.expected | 306 ------ .../basicassign3-before-analysis.il.expected | 321 ------- .../basicassign3-before-analysis.il.expected | 321 ------- .../clang/iflocal-before-analysis.il.expected | 363 ------- .../iflocal-before-analysis.il.expected | 363 ------- .../iflocal-before-analysis.il.expected | 363 ------- .../gcc/iflocal-before-analysis.il.expected | 330 ------- .../iflocal-before-analysis.il.expected | 330 ------- .../iflocal-before-analysis.il.expected | 330 ------- ...nestedifglobal-before-analysis.il.expected | 477 ---------- ...nestedifglobal-before-analysis.il.expected | 477 ---------- ...nestedifglobal-before-analysis.il.expected | 480 ---------- ...nestedifglobal-before-analysis.il.expected | 385 -------- ...nestedifglobal-before-analysis.il.expected | 385 -------- ...nestedifglobal-before-analysis.il.expected | 385 -------- 349 files changed, 119888 deletions(-) delete mode 100644 src/test/correct/arrays_simple/clang/arrays_simple-before-analysis.il.expected delete mode 100644 src/test/correct/arrays_simple/clang_O2/arrays_simple-before-analysis.il.expected delete mode 100644 src/test/correct/arrays_simple/clang_no_plt_no_pic/arrays_simple-before-analysis.il.expected delete mode 100644 src/test/correct/arrays_simple/clang_pic/arrays_simple-before-analysis.il.expected delete mode 100644 src/test/correct/arrays_simple/gcc_O2/arrays_simple-before-analysis.il.expected delete mode 100644 src/test/correct/basic_arrays_read/clang/basic_arrays_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_arrays_read/clang_O2/basic_arrays_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_arrays_read/clang_no_plt_no_pic/basic_arrays_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_arrays_read/clang_pic/basic_arrays_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_arrays_read/gcc/basic_arrays_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_arrays_read/gcc_O2/basic_arrays_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_arrays_read/gcc_no_plt_no_pic/basic_arrays_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_arrays_read/gcc_pic/basic_arrays_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_arrays_write/clang/basic_arrays_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_arrays_write/clang_O2/basic_arrays_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_arrays_write/clang_no_plt_no_pic/basic_arrays_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_arrays_write/clang_pic/basic_arrays_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_arrays_write/gcc/basic_arrays_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_arrays_write/gcc_O2/basic_arrays_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_arrays_write/gcc_no_plt_no_pic/basic_arrays_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_arrays_write/gcc_pic/basic_arrays_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_assign_assign/clang/basic_assign_assign-before-analysis.il.expected delete mode 100644 src/test/correct/basic_assign_assign/clang_O2/basic_assign_assign-before-analysis.il.expected delete mode 100644 src/test/correct/basic_assign_assign/clang_no_plt_no_pic/basic_assign_assign-before-analysis.il.expected delete mode 100644 src/test/correct/basic_assign_assign/clang_pic/basic_assign_assign-before-analysis.il.expected delete mode 100644 src/test/correct/basic_assign_assign/gcc/basic_assign_assign-before-analysis.il.expected delete mode 100644 src/test/correct/basic_assign_assign/gcc_O2/basic_assign_assign-before-analysis.il.expected delete mode 100644 src/test/correct/basic_assign_assign/gcc_no_plt_no_pic/basic_assign_assign-before-analysis.il.expected delete mode 100644 src/test/correct/basic_assign_assign/gcc_pic/basic_assign_assign-before-analysis.il.expected delete mode 100644 src/test/correct/basic_assign_increment/clang/basic_assign_increment-before-analysis.il.expected delete mode 100644 src/test/correct/basic_assign_increment/clang_O2/basic_assign_increment-before-analysis.il.expected delete mode 100644 src/test/correct/basic_assign_increment/clang_no_plt_no_pic/basic_assign_increment-before-analysis.il.expected delete mode 100644 src/test/correct/basic_assign_increment/clang_pic/basic_assign_increment-before-analysis.il.expected delete mode 100644 src/test/correct/basic_assign_increment/gcc/basic_assign_increment-before-analysis.il.expected delete mode 100644 src/test/correct/basic_assign_increment/gcc_O2/basic_assign_increment-before-analysis.il.expected delete mode 100644 src/test/correct/basic_assign_increment/gcc_no_plt_no_pic/basic_assign_increment-before-analysis.il.expected delete mode 100644 src/test/correct/basic_assign_increment/gcc_pic/basic_assign_increment-before-analysis.il.expected delete mode 100644 src/test/correct/basic_function_call_caller/clang/basic_function_call_caller-before-analysis.il.expected delete mode 100644 src/test/correct/basic_function_call_caller/clang_O2/basic_function_call_caller-before-analysis.il.expected delete mode 100644 src/test/correct/basic_function_call_caller/clang_no_plt_no_pic/basic_function_call_caller-before-analysis.il.expected delete mode 100644 src/test/correct/basic_function_call_caller/clang_pic/basic_function_call_caller-before-analysis.il.expected delete mode 100644 src/test/correct/basic_function_call_caller/gcc/basic_function_call_caller-before-analysis.il.expected delete mode 100644 src/test/correct/basic_function_call_caller/gcc_O2/basic_function_call_caller-before-analysis.il.expected delete mode 100644 src/test/correct/basic_function_call_caller/gcc_no_plt_no_pic/basic_function_call_caller-before-analysis.il.expected delete mode 100644 src/test/correct/basic_function_call_caller/gcc_pic/basic_function_call_caller-before-analysis.il.expected delete mode 100644 src/test/correct/basic_function_call_reader/clang/basic_function_call_reader-before-analysis.il.expected delete mode 100644 src/test/correct/basic_function_call_reader/clang_O2/basic_function_call_reader-before-analysis.il.expected delete mode 100644 src/test/correct/basic_function_call_reader/clang_no_plt_no_pic/basic_function_call_reader-before-analysis.il.expected delete mode 100644 src/test/correct/basic_function_call_reader/clang_pic/basic_function_call_reader-before-analysis.il.expected delete mode 100644 src/test/correct/basic_function_call_reader/gcc/basic_function_call_reader-before-analysis.il.expected delete mode 100644 src/test/correct/basic_function_call_reader/gcc_O2/basic_function_call_reader-before-analysis.il.expected delete mode 100644 src/test/correct/basic_function_call_reader/gcc_no_plt_no_pic/basic_function_call_reader-before-analysis.il.expected delete mode 100644 src/test/correct/basic_function_call_reader/gcc_pic/basic_function_call_reader-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_read/clang/basic_lock_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_read/clang_O2/basic_lock_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_read/clang_no_plt_no_pic/basic_lock_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_read/clang_pic/basic_lock_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_read/gcc/basic_lock_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_read/gcc_O2/basic_lock_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_read/gcc_no_plt_no_pic/basic_lock_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_read/gcc_pic/basic_lock_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_security_read/clang/basic_lock_security_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_security_read/clang_O2/basic_lock_security_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_security_read/clang_no_plt_no_pic/basic_lock_security_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_security_read/clang_pic/basic_lock_security_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_security_read/gcc/basic_lock_security_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_security_read/gcc_O2/basic_lock_security_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_security_read/gcc_no_plt_no_pic/basic_lock_security_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_security_read/gcc_pic/basic_lock_security_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_security_write/clang/basic_lock_security_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_security_write/clang_O2/basic_lock_security_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_security_write/clang_no_plt_no_pic/basic_lock_security_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_security_write/clang_pic/basic_lock_security_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_security_write/gcc/basic_lock_security_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_security_write/gcc_O2/basic_lock_security_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_security_write/gcc_no_plt_no_pic/basic_lock_security_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_security_write/gcc_pic/basic_lock_security_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_unlock/clang/basic_lock_unlock-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_unlock/clang_O2/basic_lock_unlock-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_unlock/clang_no_plt_no_pic/basic_lock_unlock-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_unlock/clang_pic/basic_lock_unlock-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_unlock/gcc/basic_lock_unlock-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_unlock/gcc_O2/basic_lock_unlock-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_unlock/gcc_no_plt_no_pic/basic_lock_unlock-before-analysis.il.expected delete mode 100644 src/test/correct/basic_lock_unlock/gcc_pic/basic_lock_unlock-before-analysis.il.expected delete mode 100644 src/test/correct/basic_loop_assign/clang/basic_loop_assign-before-analysis.il.expected delete mode 100644 src/test/correct/basic_loop_assign/clang_O2/basic_loop_assign-before-analysis.il.expected delete mode 100644 src/test/correct/basic_loop_assign/clang_no_plt_no_pic/basic_loop_assign-before-analysis.il.expected delete mode 100644 src/test/correct/basic_loop_assign/clang_pic/basic_loop_assign-before-analysis.il.expected delete mode 100644 src/test/correct/basic_loop_assign/gcc/basic_loop_assign-before-analysis.il.expected delete mode 100644 src/test/correct/basic_loop_assign/gcc_O2/basic_loop_assign-before-analysis.il.expected delete mode 100644 src/test/correct/basic_loop_assign/gcc_no_plt_no_pic/basic_loop_assign-before-analysis.il.expected delete mode 100644 src/test/correct/basic_loop_assign/gcc_pic/basic_loop_assign-before-analysis.il.expected delete mode 100644 src/test/correct/basic_operation_evaluation/clang/basic_operation_evaluation-before-analysis.il.expected delete mode 100644 src/test/correct/basic_operation_evaluation/clang_O2/basic_operation_evaluation-before-analysis.il.expected delete mode 100644 src/test/correct/basic_operation_evaluation/clang_no_plt_no_pic/basic_operation_evaluation-before-analysis.il.expected delete mode 100644 src/test/correct/basic_operation_evaluation/clang_pic/basic_operation_evaluation-before-analysis.il.expected delete mode 100644 src/test/correct/basic_operation_evaluation/gcc/basic_operation_evaluation-before-analysis.il.expected delete mode 100644 src/test/correct/basic_operation_evaluation/gcc_O2/basic_operation_evaluation-before-analysis.il.expected delete mode 100644 src/test/correct/basic_operation_evaluation/gcc_no_plt_no_pic/basic_operation_evaluation-before-analysis.il.expected delete mode 100644 src/test/correct/basic_operation_evaluation/gcc_pic/basic_operation_evaluation-before-analysis.il.expected delete mode 100644 src/test/correct/basic_sec_policy_read/clang/basic_sec_policy_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_sec_policy_read/clang_O2/basic_sec_policy_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_sec_policy_read/clang_no_plt_no_pic/basic_sec_policy_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_sec_policy_read/clang_pic/basic_sec_policy_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_sec_policy_read/gcc/basic_sec_policy_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_sec_policy_read/gcc_O2/basic_sec_policy_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_sec_policy_read/gcc_no_plt_no_pic/basic_sec_policy_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_sec_policy_read/gcc_pic/basic_sec_policy_read-before-analysis.il.expected delete mode 100644 src/test/correct/basic_sec_policy_write/clang/basic_sec_policy_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_sec_policy_write/clang_O2/basic_sec_policy_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_sec_policy_write/clang_no_plt_no_pic/basic_sec_policy_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_sec_policy_write/clang_pic/basic_sec_policy_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_sec_policy_write/gcc/basic_sec_policy_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_sec_policy_write/gcc_O2/basic_sec_policy_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_sec_policy_write/gcc_no_plt_no_pic/basic_sec_policy_write-before-analysis.il.expected delete mode 100644 src/test/correct/basic_sec_policy_write/gcc_pic/basic_sec_policy_write-before-analysis.il.expected delete mode 100644 src/test/correct/basicassign_gamma0/clang/basicassign_gamma0-before-analysis.il.expected delete mode 100644 src/test/correct/basicassign_gamma0/clang_O2/basicassign_gamma0-before-analysis.il.expected delete mode 100644 src/test/correct/basicassign_gamma0/clang_no_plt_no_pic/basicassign_gamma0-before-analysis.il.expected delete mode 100644 src/test/correct/basicassign_gamma0/clang_pic/basicassign_gamma0-before-analysis.il.expected delete mode 100644 src/test/correct/basicassign_gamma0/gcc/basicassign_gamma0-before-analysis.il.expected delete mode 100644 src/test/correct/basicassign_gamma0/gcc_O2/basicassign_gamma0-before-analysis.il.expected delete mode 100644 src/test/correct/basicassign_gamma0/gcc_no_plt_no_pic/basicassign_gamma0-before-analysis.il.expected delete mode 100644 src/test/correct/basicassign_gamma0/gcc_pic/basicassign_gamma0-before-analysis.il.expected delete mode 100644 src/test/correct/basicfree/clang/basicfree-before-analysis.il.expected delete mode 100644 src/test/correct/basicfree/clang_O2/basicfree-before-analysis.il.expected delete mode 100644 src/test/correct/basicfree/clang_no_plt_no_pic/basicfree-before-analysis.il.expected delete mode 100644 src/test/correct/basicfree/clang_pic/basicfree-before-analysis.il.expected delete mode 100644 src/test/correct/basicfree/gcc/basicfree-before-analysis.il.expected delete mode 100644 src/test/correct/basicfree/gcc_O2/basicfree-before-analysis.il.expected delete mode 100644 src/test/correct/basicfree/gcc_no_plt_no_pic/basicfree-before-analysis.il.expected delete mode 100644 src/test/correct/basicfree/gcc_pic/basicfree-before-analysis.il.expected delete mode 100644 src/test/correct/cjump/clang/cjump-before-analysis.il.expected delete mode 100644 src/test/correct/cjump/clang_O2/cjump-before-analysis.il.expected delete mode 100644 src/test/correct/cjump/clang_no_plt_no_pic/cjump-before-analysis.il.expected delete mode 100644 src/test/correct/cjump/clang_pic/cjump-before-analysis.il.expected delete mode 100644 src/test/correct/cjump/gcc/cjump-before-analysis.il.expected delete mode 100644 src/test/correct/cjump/gcc_O2/cjump-before-analysis.il.expected delete mode 100644 src/test/correct/cjump/gcc_no_plt_no_pic/cjump-before-analysis.il.expected delete mode 100644 src/test/correct/cjump/gcc_pic/cjump-before-analysis.il.expected delete mode 100644 src/test/correct/function/clang/function-before-analysis.il.expected delete mode 100644 src/test/correct/function/clang_O2/function-before-analysis.il.expected delete mode 100644 src/test/correct/function/clang_no_plt_no_pic/function-before-analysis.il.expected delete mode 100644 src/test/correct/function/clang_pic/function-before-analysis.il.expected delete mode 100644 src/test/correct/function/gcc/function-before-analysis.il.expected delete mode 100644 src/test/correct/function/gcc_O2/function-before-analysis.il.expected delete mode 100644 src/test/correct/function/gcc_no_plt_no_pic/function-before-analysis.il.expected delete mode 100644 src/test/correct/function/gcc_pic/function-before-analysis.il.expected delete mode 100644 src/test/correct/function1/clang/function1-before-analysis.il.expected delete mode 100644 src/test/correct/function1/clang_O2/function1-before-analysis.il.expected delete mode 100644 src/test/correct/function1/clang_no_plt_no_pic/function1-before-analysis.il.expected delete mode 100644 src/test/correct/function1/clang_pic/function1-before-analysis.il.expected delete mode 100644 src/test/correct/function1/gcc/function1-before-analysis.il.expected delete mode 100644 src/test/correct/function1/gcc_O2/function1-before-analysis.il.expected delete mode 100644 src/test/correct/function1/gcc_no_plt_no_pic/function1-before-analysis.il.expected delete mode 100644 src/test/correct/function1/gcc_pic/function1-before-analysis.il.expected delete mode 100644 src/test/correct/functions_with_params/clang/functions_with_params-before-analysis.il.expected delete mode 100644 src/test/correct/functions_with_params/clang_O2/functions_with_params-before-analysis.il.expected delete mode 100644 src/test/correct/functions_with_params/clang_no_plt_no_pic/functions_with_params-before-analysis.il.expected delete mode 100644 src/test/correct/functions_with_params/clang_pic/functions_with_params-before-analysis.il.expected delete mode 100644 src/test/correct/functions_with_params/gcc/functions_with_params-before-analysis.il.expected delete mode 100644 src/test/correct/functions_with_params/gcc_O2/functions_with_params-before-analysis.il.expected delete mode 100644 src/test/correct/functions_with_params/gcc_no_plt_no_pic/functions_with_params-before-analysis.il.expected delete mode 100644 src/test/correct/functions_with_params/gcc_pic/functions_with_params-before-analysis.il.expected delete mode 100644 src/test/correct/ifbranches/clang/ifbranches-before-analysis.il.expected delete mode 100644 src/test/correct/ifbranches/clang_O2/ifbranches-before-analysis.il.expected delete mode 100644 src/test/correct/ifbranches/clang_no_plt_no_pic/ifbranches-before-analysis.il.expected delete mode 100644 src/test/correct/ifbranches/clang_pic/ifbranches-before-analysis.il.expected delete mode 100644 src/test/correct/ifbranches/gcc/ifbranches-before-analysis.il.expected delete mode 100644 src/test/correct/ifbranches/gcc_O2/ifbranches-before-analysis.il.expected delete mode 100644 src/test/correct/ifbranches/gcc_no_plt_no_pic/ifbranches-before-analysis.il.expected delete mode 100644 src/test/correct/ifbranches/gcc_pic/ifbranches-before-analysis.il.expected delete mode 100644 src/test/correct/ifglobal/clang/ifglobal-before-analysis.il.expected delete mode 100644 src/test/correct/ifglobal/clang_O2/ifglobal-before-analysis.il.expected delete mode 100644 src/test/correct/ifglobal/clang_no_plt_no_pic/ifglobal-before-analysis.il.expected delete mode 100644 src/test/correct/ifglobal/clang_pic/ifglobal-before-analysis.il.expected delete mode 100644 src/test/correct/ifglobal/gcc/ifglobal-before-analysis.il.expected delete mode 100644 src/test/correct/ifglobal/gcc_O2/ifglobal-before-analysis.il.expected delete mode 100644 src/test/correct/ifglobal/gcc_no_plt_no_pic/ifglobal-before-analysis.il.expected delete mode 100644 src/test/correct/ifglobal/gcc_pic/ifglobal-before-analysis.il.expected delete mode 100644 src/test/correct/indirect_call/clang_O2/indirect_call-before-analysis.il.expected delete mode 100644 src/test/correct/indirect_call/gcc_O2/indirect_call-before-analysis.il.expected delete mode 100644 src/test/correct/initialisation/clang/initialisation-before-analysis.il.expected delete mode 100644 src/test/correct/initialisation/clang_O2/initialisation-before-analysis.il.expected delete mode 100644 src/test/correct/initialisation/clang_no_plt_no_pic/initialisation-before-analysis.il.expected delete mode 100644 src/test/correct/initialisation/clang_pic/initialisation-before-analysis.il.expected delete mode 100644 src/test/correct/initialisation/gcc/initialisation-before-analysis.il.expected delete mode 100644 src/test/correct/initialisation/gcc_O2/initialisation-before-analysis.il.expected delete mode 100644 src/test/correct/initialisation/gcc_no_plt_no_pic/initialisation-before-analysis.il.expected delete mode 100644 src/test/correct/initialisation/gcc_pic/initialisation-before-analysis.il.expected delete mode 100644 src/test/correct/jumptable/clang_O2/jumptable-before-analysis.il.expected delete mode 100644 src/test/correct/jumptable/gcc_O2/jumptable-before-analysis.il.expected delete mode 100644 src/test/correct/jumptable3/gcc/jumptable3-before-analysis.il.expected delete mode 100644 src/test/correct/jumptable3/gcc_O2/jumptable3-before-analysis.il.expected delete mode 100644 src/test/correct/jumptable3/gcc_no_plt_no_pic/jumptable3-before-analysis.il.expected delete mode 100644 src/test/correct/jumptable3/gcc_pic/jumptable3-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local/clang/malloc_with_local-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local/clang_O2/malloc_with_local-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local/clang_no_plt_no_pic/malloc_with_local-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local/clang_pic/malloc_with_local-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local/gcc/malloc_with_local-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local/gcc_O2/malloc_with_local-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local/gcc_no_plt_no_pic/malloc_with_local-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local/gcc_pic/malloc_with_local-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local2/clang/malloc_with_local2-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local2/clang_O2/malloc_with_local2-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local2/clang_no_plt_no_pic/malloc_with_local2-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local2/clang_pic/malloc_with_local2-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local2/gcc/malloc_with_local2-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local2/gcc_O2/malloc_with_local2-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local2/gcc_no_plt_no_pic/malloc_with_local2-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local2/gcc_pic/malloc_with_local2-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local3/clang/malloc_with_local3-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local3/clang_O2/malloc_with_local3-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local3/clang_no_plt_no_pic/malloc_with_local3-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local3/clang_pic/malloc_with_local3-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local3/gcc/malloc_with_local3-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local3/gcc_O2/malloc_with_local3-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local3/gcc_no_plt_no_pic/malloc_with_local3-before-analysis.il.expected delete mode 100644 src/test/correct/malloc_with_local3/gcc_pic/malloc_with_local3-before-analysis.il.expected delete mode 100644 src/test/correct/multi_malloc/clang/multi_malloc-before-analysis.il.expected delete mode 100644 src/test/correct/multi_malloc/clang_O2/multi_malloc-before-analysis.il.expected delete mode 100644 src/test/correct/multi_malloc/clang_no_plt_no_pic/multi_malloc-before-analysis.il.expected delete mode 100644 src/test/correct/multi_malloc/clang_pic/multi_malloc-before-analysis.il.expected delete mode 100644 src/test/correct/multi_malloc/gcc/multi_malloc-before-analysis.il.expected delete mode 100644 src/test/correct/multi_malloc/gcc_O2/multi_malloc-before-analysis.il.expected delete mode 100644 src/test/correct/multi_malloc/gcc_no_plt_no_pic/multi_malloc-before-analysis.il.expected delete mode 100644 src/test/correct/multi_malloc/gcc_pic/multi_malloc-before-analysis.il.expected delete mode 100644 src/test/correct/nestedif/clang/nestedif-before-analysis.il.expected delete mode 100644 src/test/correct/nestedif/clang_O2/nestedif-before-analysis.il.expected delete mode 100644 src/test/correct/nestedif/clang_no_plt_no_pic/nestedif-before-analysis.il.expected delete mode 100644 src/test/correct/nestedif/clang_pic/nestedif-before-analysis.il.expected delete mode 100644 src/test/correct/nestedif/gcc/nestedif-before-analysis.il.expected delete mode 100644 src/test/correct/nestedif/gcc_O2/nestedif-before-analysis.il.expected delete mode 100644 src/test/correct/nestedif/gcc_no_plt_no_pic/nestedif-before-analysis.il.expected delete mode 100644 src/test/correct/nestedif/gcc_pic/nestedif-before-analysis.il.expected delete mode 100644 src/test/correct/no_interference_update_x/clang/no_interference_update_x-before-analysis.il.expected delete mode 100644 src/test/correct/no_interference_update_x/clang_O2/no_interference_update_x-before-analysis.il.expected delete mode 100644 src/test/correct/no_interference_update_x/clang_no_plt_no_pic/no_interference_update_x-before-analysis.il.expected delete mode 100644 src/test/correct/no_interference_update_x/clang_pic/no_interference_update_x-before-analysis.il.expected delete mode 100644 src/test/correct/no_interference_update_x/gcc/no_interference_update_x-before-analysis.il.expected delete mode 100644 src/test/correct/no_interference_update_x/gcc_O2/no_interference_update_x-before-analysis.il.expected delete mode 100644 src/test/correct/no_interference_update_x/gcc_no_plt_no_pic/no_interference_update_x-before-analysis.il.expected delete mode 100644 src/test/correct/no_interference_update_x/gcc_pic/no_interference_update_x-before-analysis.il.expected delete mode 100644 src/test/correct/no_interference_update_y/clang/no_interference_update_y-before-analysis.il.expected delete mode 100644 src/test/correct/no_interference_update_y/clang_O2/no_interference_update_y-before-analysis.il.expected delete mode 100644 src/test/correct/no_interference_update_y/clang_no_plt_no_pic/no_interference_update_y-before-analysis.il.expected delete mode 100644 src/test/correct/no_interference_update_y/clang_pic/no_interference_update_y-before-analysis.il.expected delete mode 100644 src/test/correct/no_interference_update_y/gcc/no_interference_update_y-before-analysis.il.expected delete mode 100644 src/test/correct/no_interference_update_y/gcc_O2/no_interference_update_y-before-analysis.il.expected delete mode 100644 src/test/correct/no_interference_update_y/gcc_no_plt_no_pic/no_interference_update_y-before-analysis.il.expected delete mode 100644 src/test/correct/no_interference_update_y/gcc_pic/no_interference_update_y-before-analysis.il.expected delete mode 100644 src/test/correct/secret_write/clang/secret_write-before-analysis.il.expected delete mode 100644 src/test/correct/secret_write/clang_O2/secret_write-before-analysis.il.expected delete mode 100644 src/test/correct/secret_write/clang_no_plt_no_pic/secret_write-before-analysis.il.expected delete mode 100644 src/test/correct/secret_write/clang_pic/secret_write-before-analysis.il.expected delete mode 100644 src/test/correct/secret_write/gcc/secret_write-before-analysis.il.expected delete mode 100644 src/test/correct/secret_write/gcc_O2/secret_write-before-analysis.il.expected delete mode 100644 src/test/correct/secret_write/gcc_no_plt_no_pic/secret_write-before-analysis.il.expected delete mode 100644 src/test/correct/secret_write/gcc_pic/secret_write-before-analysis.il.expected delete mode 100644 src/test/correct/simple_jump/clang/simple_jump-before-analysis.il.expected delete mode 100644 src/test/correct/simple_jump/clang_O2/simple_jump-before-analysis.il.expected delete mode 100644 src/test/correct/simple_jump/clang_no_plt_no_pic/simple_jump-before-analysis.il.expected delete mode 100644 src/test/correct/simple_jump/clang_pic/simple_jump-before-analysis.il.expected delete mode 100644 src/test/correct/simple_jump/gcc/simple_jump-before-analysis.il.expected delete mode 100644 src/test/correct/simple_jump/gcc_O2/simple_jump-before-analysis.il.expected delete mode 100644 src/test/correct/simple_jump/gcc_no_plt_no_pic/simple_jump-before-analysis.il.expected delete mode 100644 src/test/correct/simple_jump/gcc_pic/simple_jump-before-analysis.il.expected delete mode 100644 src/test/correct/switch/clang/switch-before-analysis.il.expected delete mode 100644 src/test/correct/switch/clang_O2/switch-before-analysis.il.expected delete mode 100644 src/test/correct/switch/clang_no_plt_no_pic/switch-before-analysis.il.expected delete mode 100644 src/test/correct/switch/clang_pic/switch-before-analysis.il.expected delete mode 100644 src/test/correct/switch/gcc/switch-before-analysis.il.expected delete mode 100644 src/test/correct/switch/gcc_O2/switch-before-analysis.il.expected delete mode 100644 src/test/correct/switch/gcc_no_plt_no_pic/switch-before-analysis.il.expected delete mode 100644 src/test/correct/switch/gcc_pic/switch-before-analysis.il.expected delete mode 100644 src/test/correct/switch2/clang_O2/switch2-before-analysis.il.expected delete mode 100644 src/test/correct/switch2/gcc/switch2-before-analysis.il.expected delete mode 100644 src/test/correct/switch2/gcc_O2/switch2-before-analysis.il.expected delete mode 100644 src/test/correct/switch2/gcc_no_plt_no_pic/switch2-before-analysis.il.expected delete mode 100644 src/test/correct/switch2/gcc_pic/switch2-before-analysis.il.expected delete mode 100644 src/test/correct/syscall/clang/syscall-before-analysis.il.expected delete mode 100644 src/test/correct/syscall/clang_no_plt_no_pic/syscall-before-analysis.il.expected delete mode 100644 src/test/correct/syscall/clang_pic/syscall-before-analysis.il.expected delete mode 100644 src/test/correct/syscall/gcc/syscall-before-analysis.il.expected delete mode 100644 src/test/correct/syscall/gcc_O2/syscall-before-analysis.il.expected delete mode 100644 src/test/correct/syscall/gcc_no_plt_no_pic/syscall-before-analysis.il.expected delete mode 100644 src/test/correct/syscall/gcc_pic/syscall-before-analysis.il.expected delete mode 100644 src/test/correct/using_gamma_conditional/clang/using_gamma_conditional-before-analysis.il.expected delete mode 100644 src/test/correct/using_gamma_conditional/clang_O2/using_gamma_conditional-before-analysis.il.expected delete mode 100644 src/test/correct/using_gamma_conditional/clang_no_plt_no_pic/using_gamma_conditional-before-analysis.il.expected delete mode 100644 src/test/correct/using_gamma_conditional/clang_pic/using_gamma_conditional-before-analysis.il.expected delete mode 100644 src/test/correct/using_gamma_conditional/gcc/using_gamma_conditional-before-analysis.il.expected delete mode 100644 src/test/correct/using_gamma_conditional/gcc_O2/using_gamma_conditional-before-analysis.il.expected delete mode 100644 src/test/correct/using_gamma_conditional/gcc_no_plt_no_pic/using_gamma_conditional-before-analysis.il.expected delete mode 100644 src/test/correct/using_gamma_conditional/gcc_pic/using_gamma_conditional-before-analysis.il.expected delete mode 100644 src/test/correct/using_gamma_write_z/clang/using_gamma_write_z-before-analysis.il.expected delete mode 100644 src/test/correct/using_gamma_write_z/clang_O2/using_gamma_write_z-before-analysis.il.expected delete mode 100644 src/test/correct/using_gamma_write_z/clang_no_plt_no_pic/using_gamma_write_z-before-analysis.il.expected delete mode 100644 src/test/correct/using_gamma_write_z/clang_pic/using_gamma_write_z-before-analysis.il.expected delete mode 100644 src/test/correct/using_gamma_write_z/gcc/using_gamma_write_z-before-analysis.il.expected delete mode 100644 src/test/correct/using_gamma_write_z/gcc_O2/using_gamma_write_z-before-analysis.il.expected delete mode 100644 src/test/correct/using_gamma_write_z/gcc_no_plt_no_pic/using_gamma_write_z-before-analysis.il.expected delete mode 100644 src/test/correct/using_gamma_write_z/gcc_pic/using_gamma_write_z-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign/clang/basicassign-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign/clang_O2/basicassign-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign/clang_no_plt_no_pic/basicassign-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign/clang_pic/basicassign-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign/gcc/basicassign-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign/gcc_O2/basicassign-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign/gcc_no_plt_no_pic/basicassign-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign/gcc_pic/basicassign-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign1/clang/basicassign1-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign1/clang_O2/basicassign1-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign1/clang_no_plt_no_pic/basicassign1-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign1/clang_pic/basicassign1-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign1/gcc/basicassign1-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign1/gcc_O2/basicassign1-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign1/gcc_no_plt_no_pic/basicassign1-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign1/gcc_pic/basicassign1-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign2/clang/basicassign2-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign2/clang_O2/basicassign2-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign2/clang_no_plt_no_pic/basicassign2-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign2/clang_pic/basicassign2-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign2/gcc/basicassign2-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign2/gcc_O2/basicassign2-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign2/gcc_no_plt_no_pic/basicassign2-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign2/gcc_pic/basicassign2-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign3/clang/basicassign3-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign3/clang_O2/basicassign3-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign3/clang_no_plt_no_pic/basicassign3-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign3/clang_pic/basicassign3-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign3/gcc/basicassign3-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign3/gcc_O2/basicassign3-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign3/gcc_no_plt_no_pic/basicassign3-before-analysis.il.expected delete mode 100644 src/test/incorrect/basicassign3/gcc_pic/basicassign3-before-analysis.il.expected delete mode 100644 src/test/incorrect/iflocal/clang/iflocal-before-analysis.il.expected delete mode 100644 src/test/incorrect/iflocal/clang_no_plt_no_pic/iflocal-before-analysis.il.expected delete mode 100644 src/test/incorrect/iflocal/clang_pic/iflocal-before-analysis.il.expected delete mode 100644 src/test/incorrect/iflocal/gcc/iflocal-before-analysis.il.expected delete mode 100644 src/test/incorrect/iflocal/gcc_no_plt_no_pic/iflocal-before-analysis.il.expected delete mode 100644 src/test/incorrect/iflocal/gcc_pic/iflocal-before-analysis.il.expected delete mode 100644 src/test/incorrect/nestedifglobal/clang/nestedifglobal-before-analysis.il.expected delete mode 100644 src/test/incorrect/nestedifglobal/clang_no_plt_no_pic/nestedifglobal-before-analysis.il.expected delete mode 100644 src/test/incorrect/nestedifglobal/clang_pic/nestedifglobal-before-analysis.il.expected delete mode 100644 src/test/incorrect/nestedifglobal/gcc/nestedifglobal-before-analysis.il.expected delete mode 100644 src/test/incorrect/nestedifglobal/gcc_no_plt_no_pic/nestedifglobal-before-analysis.il.expected delete mode 100644 src/test/incorrect/nestedifglobal/gcc_pic/nestedifglobal-before-analysis.il.expected diff --git a/src/test/correct/arrays_simple/clang/arrays_simple-before-analysis.il.expected b/src/test/correct/arrays_simple/clang/arrays_simple-before-analysis.il.expected deleted file mode 100644 index 5758766d6..000000000 --- a/src/test/correct/arrays_simple/clang/arrays_simple-before-analysis.il.expected +++ /dev/null @@ -1,310 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000861", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000008c9", condition()) - ) - ) - Block("1752:l000008c9", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000008d7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000008f0", condition()) - ) - ) - Block("1764:l000008f0", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000008d7", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000008e3", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000861", condition()) - ) - ) - Block("1788:l00000861", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1852:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1852:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000acd", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000078b", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000b59", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000940", condition()) - ) - ) - Block("1604:l000007a1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000940", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000007e6", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000922", condition()) - ) - ) - Block("1640:l00000922", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l000007e6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000935", condition()) - ) - ) - Block("1660:l000007e6", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000935", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - LocalAssign(Register(R8, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 7bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000822", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000904", condition()) - ) - ) - Block("1700:l00000904", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000822", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000917", condition()) - ) - ) - Block("1720:l00000822", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000917", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/arrays_simple/clang_O2/arrays_simple-before-analysis.il.expected b/src/test/correct/arrays_simple/clang_O2/arrays_simple-before-analysis.il.expected deleted file mode 100644 index 5a5a5bf1d..000000000 --- a/src/test/correct/arrays_simple/clang_O2/arrays_simple-before-analysis.il.expected +++ /dev/null @@ -1,302 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000289", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002bc", condition()) - ) - ) - Block("1752:l000002bc", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000002e3", condition()) - ) - ) - Block("1764:l000002e3", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002ca", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002d6", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000289", condition()) - ) - ) - Block("1788:l00000289", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1820:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1820:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004b8", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001b3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000055e", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001c9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000333", condition()) - ) - ) - Block("1604:l000001c9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000333", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000020e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000315", condition()) - ) - ) - Block("1640:l00000315", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000020e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000328", condition()) - ) - ) - Block("1660:l0000020e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000328", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000002f7", condition()) - ) - ) - Block("1700:l000002f7", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000030a", condition()) - ) - ) - Block("1720:l0000024a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000030a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/arrays_simple/clang_no_plt_no_pic/arrays_simple-before-analysis.il.expected b/src/test/correct/arrays_simple/clang_no_plt_no_pic/arrays_simple-before-analysis.il.expected deleted file mode 100644 index 5758766d6..000000000 --- a/src/test/correct/arrays_simple/clang_no_plt_no_pic/arrays_simple-before-analysis.il.expected +++ /dev/null @@ -1,310 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000861", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000008c9", condition()) - ) - ) - Block("1752:l000008c9", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000008d7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000008f0", condition()) - ) - ) - Block("1764:l000008f0", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000008d7", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000008e3", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000861", condition()) - ) - ) - Block("1788:l00000861", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1852:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1852:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000acd", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000078b", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000b59", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000940", condition()) - ) - ) - Block("1604:l000007a1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000940", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000007e6", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000922", condition()) - ) - ) - Block("1640:l00000922", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l000007e6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000935", condition()) - ) - ) - Block("1660:l000007e6", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000935", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - LocalAssign(Register(R8, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 7bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000822", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000904", condition()) - ) - ) - Block("1700:l00000904", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000822", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000917", condition()) - ) - ) - Block("1720:l00000822", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000917", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/arrays_simple/clang_pic/arrays_simple-before-analysis.il.expected b/src/test/correct/arrays_simple/clang_pic/arrays_simple-before-analysis.il.expected deleted file mode 100644 index 5758766d6..000000000 --- a/src/test/correct/arrays_simple/clang_pic/arrays_simple-before-analysis.il.expected +++ /dev/null @@ -1,310 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000861", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000008c9", condition()) - ) - ) - Block("1752:l000008c9", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000008d7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000008f0", condition()) - ) - ) - Block("1764:l000008f0", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000008d7", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000008e3", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000861", condition()) - ) - ) - Block("1788:l00000861", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1852:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1852:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000acd", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000078b", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000b59", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000940", condition()) - ) - ) - Block("1604:l000007a1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000940", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000007e6", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000922", condition()) - ) - ) - Block("1640:l00000922", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l000007e6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000935", condition()) - ) - ) - Block("1660:l000007e6", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000935", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - LocalAssign(Register(R8, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 7bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000822", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000904", condition()) - ) - ) - Block("1700:l00000904", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000822", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000917", condition()) - ) - ) - Block("1720:l00000822", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000917", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/arrays_simple/gcc_O2/arrays_simple-before-analysis.il.expected b/src/test/correct/arrays_simple/gcc_O2/arrays_simple-before-analysis.il.expected deleted file mode 100644 index 82dc9ebf6..000000000 --- a/src/test/correct/arrays_simple/gcc_O2/arrays_simple-before-analysis.il.expected +++ /dev/null @@ -1,302 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002e7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000310", condition()) - ) - ) - Block("1816:l00000310", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000031e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000337", condition()) - ) - ) - Block("1828:l00000337", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000031e", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000032a", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002e7", condition()) - ) - ) - Block("1852:l000002e7", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l0000051a", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000211", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005ce", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000227", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000387", condition()) - ) - ) - Block("1668:l00000227", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000387", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000026c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000369", condition()) - ) - ) - Block("1704:l00000369", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l0000026c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l0000037c", condition()) - ) - ) - Block("1724:l0000026c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l0000037c", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002a8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000034b", condition()) - ) - ) - Block("1764:l0000034b", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002a8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000035e", condition()) - ) - ) - Block("1784:l000002a8", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000035e", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_arrays_read/clang/basic_arrays_read-before-analysis.il.expected b/src/test/correct/basic_arrays_read/clang/basic_arrays_read-before-analysis.il.expected deleted file mode 100644 index 7e1aa608c..000000000 --- a/src/test/correct/basic_arrays_read/clang/basic_arrays_read-before-analysis.il.expected +++ /dev/null @@ -1,307 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002f1", condition()) - ) - ) - Block("1752:l000002f1", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002ff", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000318", condition()) - ) - ) - Block("1764:l00000318", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002ff", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000030b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000029d", condition()) - ) - ) - Block("1788:l0000029d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1840:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004f2", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000059d", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000368", condition()) - ) - ) - Block("1604:l000001dd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000368", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000034a", condition()) - ) - ) - Block("1640:l0000034a", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000035d", condition()) - ) - ) - Block("1660:l00000222", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000035d", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000032c", condition()) - ) - ) - Block("1700:l0000032c", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000033f", condition()) - ) - ) - Block("1720:l0000025e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000033f", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_arrays_read/clang_O2/basic_arrays_read-before-analysis.il.expected b/src/test/correct/basic_arrays_read/clang_O2/basic_arrays_read-before-analysis.il.expected deleted file mode 100644 index 6d9c101ec..000000000 --- a/src/test/correct/basic_arrays_read/clang_O2/basic_arrays_read-before-analysis.il.expected +++ /dev/null @@ -1,304 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000291", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002d0", condition()) - ) - ) - Block("1752:l000002d0", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002de", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000002f7", condition()) - ) - ) - Block("1764:l000002f7", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002de", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002ea", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000291", condition()) - ) - ) - Block("1788:l00000291", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1828:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1828:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004ce", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001bb", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000576", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000347", condition()) - ) - ) - Block("1604:l000001d1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000347", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000216", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000329", condition()) - ) - ) - Block("1640:l00000329", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000216", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000033c", condition()) - ) - ) - Block("1660:l00000216", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000033c", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := 0bv32)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000030b", condition()) - ) - ) - Block("1700:l0000030b", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000031e", condition()) - ) - ) - Block("1720:l00000252", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000031e", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_arrays_read/clang_no_plt_no_pic/basic_arrays_read-before-analysis.il.expected b/src/test/correct/basic_arrays_read/clang_no_plt_no_pic/basic_arrays_read-before-analysis.il.expected deleted file mode 100644 index 7dec3024b..000000000 --- a/src/test/correct/basic_arrays_read/clang_no_plt_no_pic/basic_arrays_read-before-analysis.il.expected +++ /dev/null @@ -1,307 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000082f", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000883", condition()) - ) - ) - Block("1752:l00000883", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000891", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000008aa", condition()) - ) - ) - Block("1764:l000008aa", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000891", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000089d", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000082f", condition()) - ) - ) - Block("1788:l0000082f", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1840:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000a84", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000759", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000b0d", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000076f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000008fa", condition()) - ) - ) - Block("1604:l0000076f", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000008fa", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000007b4", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000008dc", condition()) - ) - ) - Block("1640:l000008dc", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l000007b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000008ef", condition()) - ) - ) - Block("1660:l000007b4", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000008ef", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000007f0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000008be", condition()) - ) - ) - Block("1700:l000008be", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000007f0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000008d1", condition()) - ) - ) - Block("1720:l000007f0", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000008d1", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_arrays_read/clang_pic/basic_arrays_read-before-analysis.il.expected b/src/test/correct/basic_arrays_read/clang_pic/basic_arrays_read-before-analysis.il.expected deleted file mode 100644 index 5581ed4db..000000000 --- a/src/test/correct/basic_arrays_read/clang_pic/basic_arrays_read-before-analysis.il.expected +++ /dev/null @@ -1,308 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002a1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000002fc", condition()) - ) - ) - Block("1816:l000002fc", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) - ), - jumps( - GoTo("1840:l0000030a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000323", condition()) - ) - ) - Block("1828:l00000323", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000030a", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000316", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002a1", condition()) - ) - ) - Block("1852:l000002a1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1908:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1908:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l000004aa", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001cb", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l00000556", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1668:l000001e1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000373", condition()) - ) - ) - Block("1668:l000001e1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000373", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000355", condition()) - ) - ) - Block("1704:l00000355", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) - ), - jumps( - GoTo("1724:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000368", condition()) - ) - ) - Block("1724:l00000226", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000368", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4056bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000337", condition()) - ) - ) - Block("1764:l00000337", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000034a", condition()) - ) - ) - Block("1784:l00000262", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000034a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_arrays_read/gcc/basic_arrays_read-before-analysis.il.expected b/src/test/correct/basic_arrays_read/gcc/basic_arrays_read-before-analysis.il.expected deleted file mode 100644 index 8fc7bd546..000000000 --- a/src/test/correct/basic_arrays_read/gcc/basic_arrays_read-before-analysis.il.expected +++ /dev/null @@ -1,307 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002ef", condition()) - ) - ) - Block("1752:l000002ef", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000002fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000316", condition()) - ) - ) - Block("1764:l00000316", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002fd", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000309", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000029d", condition()) - ) - ) - Block("1788:l0000029d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1840:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004f0", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000059b", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000366", condition()) - ) - ) - Block("1604:l000001dd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000366", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000348", condition()) - ) - ) - Block("1640:l00000348", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000035b", condition()) - ) - ) - Block("1660:l00000222", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000035b", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000032a", condition()) - ) - ) - Block("1700:l0000032a", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000033d", condition()) - ) - ) - Block("1720:l0000025e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000033d", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_arrays_read/gcc_O2/basic_arrays_read-before-analysis.il.expected b/src/test/correct/basic_arrays_read/gcc_O2/basic_arrays_read-before-analysis.il.expected deleted file mode 100644 index b4c451289..000000000 --- a/src/test/correct/basic_arrays_read/gcc_O2/basic_arrays_read-before-analysis.il.expected +++ /dev/null @@ -1,304 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002ef", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000318", condition()) - ) - ) - Block("1816:l00000318", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l00000326", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000033f", condition()) - ) - ) - Block("1828:l0000033f", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000326", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000332", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002ef", condition()) - ) - ) - Block("1852:l000002ef", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l00000522", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000219", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005d6", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l0000022f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000038f", condition()) - ) - ) - Block("1668:l0000022f", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000038f", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000274", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000371", condition()) - ) - ) - Block("1704:l00000371", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000274", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000384", condition()) - ) - ) - Block("1724:l00000274", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000384", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 24bv64)] := 0bv32)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002b0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000353", condition()) - ) - ) - Block("1764:l00000353", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002b0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000366", condition()) - ) - ) - Block("1784:l000002b0", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000366", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_arrays_read/gcc_no_plt_no_pic/basic_arrays_read-before-analysis.il.expected b/src/test/correct/basic_arrays_read/gcc_no_plt_no_pic/basic_arrays_read-before-analysis.il.expected deleted file mode 100644 index 806dca616..000000000 --- a/src/test/correct/basic_arrays_read/gcc_no_plt_no_pic/basic_arrays_read-before-analysis.il.expected +++ /dev/null @@ -1,307 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000082d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000087f", condition()) - ) - ) - Block("1752:l0000087f", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l0000088d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000008a6", condition()) - ) - ) - Block("1764:l000008a6", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000088d", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000899", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000082d", condition()) - ) - ) - Block("1788:l0000082d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1840:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000a80", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000757", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000b09", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l0000076d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000008f6", condition()) - ) - ) - Block("1604:l0000076d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000008f6", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000007b2", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000008d8", condition()) - ) - ) - Block("1640:l000008d8", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l000007b2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000008eb", condition()) - ) - ) - Block("1660:l000007b2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000008eb", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000007ee", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000008ba", condition()) - ) - ) - Block("1700:l000008ba", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000007ee", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000008cd", condition()) - ) - ) - Block("1720:l000007ee", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000008cd", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_arrays_read/gcc_pic/basic_arrays_read-before-analysis.il.expected b/src/test/correct/basic_arrays_read/gcc_pic/basic_arrays_read-before-analysis.il.expected deleted file mode 100644 index ce0e2bd97..000000000 --- a/src/test/correct/basic_arrays_read/gcc_pic/basic_arrays_read-before-analysis.il.expected +++ /dev/null @@ -1,307 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000002f1", condition()) - ) - ) - Block("1816:l000002f1", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - ), - jumps( - GoTo("1840:l000002ff", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000318", condition()) - ) - ) - Block("1828:l00000318", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l000002ff", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000030b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l0000029d", condition()) - ) - ) - Block("1852:l0000029d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1904:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1904:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l0000049f", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001c7", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l0000054a", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1668:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000368", condition()) - ) - ) - Block("1668:l000001dd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000368", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000034a", condition()) - ) - ) - Block("1704:l0000034a", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) - ), - jumps( - GoTo("1724:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l0000035d", condition()) - ) - ) - Block("1724:l00000222", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l0000035d", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000032c", condition()) - ) - ) - Block("1764:l0000032c", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000033f", condition()) - ) - ) - Block("1784:l0000025e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000033f", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_arrays_write/clang/basic_arrays_write-before-analysis.il.expected b/src/test/correct/basic_arrays_write/clang/basic_arrays_write-before-analysis.il.expected deleted file mode 100644 index 6ac62f93a..000000000 --- a/src/test/correct/basic_arrays_write/clang/basic_arrays_write-before-analysis.il.expected +++ /dev/null @@ -1,309 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000306", condition()) - ) - ) - Block("1752:l00000306", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000314", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000032d", condition()) - ) - ) - Block("1764:l0000032d", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000314", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000320", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002a5", condition()) - ) - ) - Block("1788:l000002a5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1848:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000509", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001cf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005b6", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000037d", condition()) - ) - ) - Block("1604:l000001e5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000037d", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000035f", condition()) - ) - ) - Block("1640:l0000035f", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000372", condition()) - ) - ) - Block("1660:l0000022a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000372", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := BinaryExpr("add", Register(R9, bv64), 52bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000341", condition()) - ) - ) - Block("1700:l00000341", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000354", condition()) - ) - ) - Block("1720:l00000266", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000354", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_arrays_write/clang_O2/basic_arrays_write-before-analysis.il.expected b/src/test/correct/basic_arrays_write/clang_O2/basic_arrays_write-before-analysis.il.expected deleted file mode 100644 index ea40731da..000000000 --- a/src/test/correct/basic_arrays_write/clang_O2/basic_arrays_write-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002db", condition()) - ) - ) - Block("1752:l000002db", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002e9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000302", condition()) - ) - ) - Block("1764:l00000302", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002e9", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002f5", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000295", condition()) - ) - ) - Block("1788:l00000295", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1832:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004da", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001bf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000583", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000352", condition()) - ) - ) - Block("1604:l000001d5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000352", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000334", condition()) - ) - ) - Block("1640:l00000334", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000347", condition()) - ) - ) - Block("1660:l0000021a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000347", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000316", condition()) - ) - ) - Block("1700:l00000316", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000329", condition()) - ) - ) - Block("1720:l00000256", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000329", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_arrays_write/clang_no_plt_no_pic/basic_arrays_write-before-analysis.il.expected b/src/test/correct/basic_arrays_write/clang_no_plt_no_pic/basic_arrays_write-before-analysis.il.expected deleted file mode 100644 index 6e50562ef..000000000 --- a/src/test/correct/basic_arrays_write/clang_no_plt_no_pic/basic_arrays_write-before-analysis.il.expected +++ /dev/null @@ -1,309 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000850", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000008b1", condition()) - ) - ) - Block("1752:l000008b1", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000008bf", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000008d8", condition()) - ) - ) - Block("1764:l000008d8", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000008bf", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000008cb", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000850", condition()) - ) - ) - Block("1788:l00000850", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1848:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000ab4", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000077a", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000b3f", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000790", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000928", condition()) - ) - ) - Block("1604:l00000790", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000928", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000007d5", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000090a", condition()) - ) - ) - Block("1640:l0000090a", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l000007d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000091d", condition()) - ) - ) - Block("1660:l000007d5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000091d", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := BinaryExpr("add", Register(R9, bv64), 52bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000811", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000008ec", condition()) - ) - ) - Block("1700:l000008ec", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000811", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000008ff", condition()) - ) - ) - Block("1720:l00000811", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000008ff", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_arrays_write/clang_pic/basic_arrays_write-before-analysis.il.expected b/src/test/correct/basic_arrays_write/clang_pic/basic_arrays_write-before-analysis.il.expected deleted file mode 100644 index 69ef2431f..000000000 --- a/src/test/correct/basic_arrays_write/clang_pic/basic_arrays_write-before-analysis.il.expected +++ /dev/null @@ -1,309 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000307", condition()) - ) - ) - Block("1816:l00000307", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) - ), - jumps( - GoTo("1840:l00000315", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000032e", condition()) - ) - ) - Block("1828:l0000032e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000315", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000321", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002a5", condition()) - ) - ) - Block("1852:l000002a5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1912:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1912:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l000004b5", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001cf", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l00000562", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1668:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000037e", condition()) - ) - ) - Block("1668:l000001e5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000037e", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000360", condition()) - ) - ) - Block("1704:l00000360", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) - ), - jumps( - GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000373", condition()) - ) - ) - Block("1724:l0000022a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000373", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4056bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000342", condition()) - ) - ) - Block("1764:l00000342", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000355", condition()) - ) - ) - Block("1784:l00000266", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000355", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_arrays_write/gcc/basic_arrays_write-before-analysis.il.expected b/src/test/correct/basic_arrays_write/gcc/basic_arrays_write-before-analysis.il.expected deleted file mode 100644 index b0202a53d..000000000 --- a/src/test/correct/basic_arrays_write/gcc/basic_arrays_write-before-analysis.il.expected +++ /dev/null @@ -1,309 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000306", condition()) - ) - ) - Block("1752:l00000306", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000314", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000032d", condition()) - ) - ) - Block("1764:l0000032d", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000314", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000320", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002a5", condition()) - ) - ) - Block("1788:l000002a5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1848:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000509", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001cf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005b6", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000037d", condition()) - ) - ) - Block("1604:l000001e5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000037d", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000035f", condition()) - ) - ) - Block("1640:l0000035f", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000372", condition()) - ) - ) - Block("1660:l0000022a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000372", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R0, bv64), 4bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000341", condition()) - ) - ) - Block("1700:l00000341", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000354", condition()) - ) - ) - Block("1720:l00000266", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000354", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_arrays_write/gcc_O2/basic_arrays_write-before-analysis.il.expected b/src/test/correct/basic_arrays_write/gcc_O2/basic_arrays_write-before-analysis.il.expected deleted file mode 100644 index 1c750f3dd..000000000 --- a/src/test/correct/basic_arrays_write/gcc_O2/basic_arrays_write-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f4", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000031d", condition()) - ) - ) - Block("1816:l0000031d", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000032b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000344", condition()) - ) - ) - Block("1828:l00000344", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000032b", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000337", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f4", condition()) - ) - ) - Block("1852:l000002f4", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l00000527", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l0000021e", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005db", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000234", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000394", condition()) - ) - ) - Block("1668:l00000234", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000394", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000279", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000376", condition()) - ) - ) - Block("1704:l00000376", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000279", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000389", condition()) - ) - ) - Block("1724:l00000279", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000389", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R2, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 28bv64)] := Extract(Register(R2, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002b5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000358", condition()) - ) - ) - Block("1764:l00000358", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002b5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000036b", condition()) - ) - ) - Block("1784:l000002b5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000036b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_arrays_write/gcc_no_plt_no_pic/basic_arrays_write-before-analysis.il.expected b/src/test/correct/basic_arrays_write/gcc_no_plt_no_pic/basic_arrays_write-before-analysis.il.expected deleted file mode 100644 index 0348623ae..000000000 --- a/src/test/correct/basic_arrays_write/gcc_no_plt_no_pic/basic_arrays_write-before-analysis.il.expected +++ /dev/null @@ -1,309 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000850", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000008b1", condition()) - ) - ) - Block("1752:l000008b1", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000008bf", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000008d8", condition()) - ) - ) - Block("1764:l000008d8", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000008bf", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000008cb", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000850", condition()) - ) - ) - Block("1788:l00000850", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1848:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000ab4", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000077a", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000b3f", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000790", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000928", condition()) - ) - ) - Block("1604:l00000790", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000928", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000007d5", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000090a", condition()) - ) - ) - Block("1640:l0000090a", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l000007d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000091d", condition()) - ) - ) - Block("1660:l000007d5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000091d", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R0, bv64), 4bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000811", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000008ec", condition()) - ) - ) - Block("1700:l000008ec", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000811", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000008ff", condition()) - ) - ) - Block("1720:l00000811", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000008ff", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_arrays_write/gcc_pic/basic_arrays_write-before-analysis.il.expected b/src/test/correct/basic_arrays_write/gcc_pic/basic_arrays_write-before-analysis.il.expected deleted file mode 100644 index a20b05a7e..000000000 --- a/src/test/correct/basic_arrays_write/gcc_pic/basic_arrays_write-before-analysis.il.expected +++ /dev/null @@ -1,309 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000307", condition()) - ) - ) - Block("1816:l00000307", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - ), - jumps( - GoTo("1840:l00000315", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000032e", condition()) - ) - ) - Block("1828:l0000032e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000315", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000321", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002a5", condition()) - ) - ) - Block("1852:l000002a5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1912:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1912:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l000004b5", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001cf", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l00000562", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1668:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000037e", condition()) - ) - ) - Block("1668:l000001e5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000037e", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000360", condition()) - ) - ) - Block("1704:l00000360", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) - ), - jumps( - GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000373", condition()) - ) - ) - Block("1724:l0000022a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000373", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R0, bv64), 4bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000342", condition()) - ) - ) - Block("1764:l00000342", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000355", condition()) - ) - ) - Block("1784:l00000266", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000355", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_assign_assign/clang/basic_assign_assign-before-analysis.il.expected b/src/test/correct/basic_assign_assign/clang/basic_assign_assign-before-analysis.il.expected deleted file mode 100644 index ce52ab33b..000000000 --- a/src/test/correct/basic_assign_assign/clang/basic_assign_assign-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002da", condition()) - ) - ) - Block("1752:l000002da", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000301", condition()) - ) - ) - Block("1764:l00000301", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002e8", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002f4", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000295", condition()) - ) - ) - Block("1788:l00000295", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1832:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004d9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001bf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000582", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000351", condition()) - ) - ) - Block("1604:l000001d5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000351", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000333", condition()) - ) - ) - Block("1640:l00000333", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000346", condition()) - ) - ) - Block("1660:l0000021a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000346", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000315", condition()) - ) - ) - Block("1700:l00000315", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000328", condition()) - ) - ) - Block("1720:l00000256", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000328", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_assign_assign/clang_O2/basic_assign_assign-before-analysis.il.expected b/src/test/correct/basic_assign_assign/clang_O2/basic_assign_assign-before-analysis.il.expected deleted file mode 100644 index d6959f31d..000000000 --- a/src/test/correct/basic_assign_assign/clang_O2/basic_assign_assign-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002da", condition()) - ) - ) - Block("1752:l000002da", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000301", condition()) - ) - ) - Block("1764:l00000301", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002e8", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002f4", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000295", condition()) - ) - ) - Block("1788:l00000295", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1832:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004d9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001bf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000582", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000351", condition()) - ) - ) - Block("1604:l000001d5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000351", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000333", condition()) - ) - ) - Block("1640:l00000333", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000346", condition()) - ) - ) - Block("1660:l0000021a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000346", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 5bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000315", condition()) - ) - ) - Block("1700:l00000315", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000328", condition()) - ) - ) - Block("1720:l00000256", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000328", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_assign_assign/clang_no_plt_no_pic/basic_assign_assign-before-analysis.il.expected b/src/test/correct/basic_assign_assign/clang_no_plt_no_pic/basic_assign_assign-before-analysis.il.expected deleted file mode 100644 index 6355e69c7..000000000 --- a/src/test/correct/basic_assign_assign/clang_no_plt_no_pic/basic_assign_assign-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000080c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000851", condition()) - ) - ) - Block("1752:l00000851", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000085f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000878", condition()) - ) - ) - Block("1764:l00000878", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000085f", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000086b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000080c", condition()) - ) - ) - Block("1788:l0000080c", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1832:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000a50", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000736", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000ad7", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000074c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000008c8", condition()) - ) - ) - Block("1604:l0000074c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000008c8", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000008aa", condition()) - ) - ) - Block("1640:l000008aa", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000008bd", condition()) - ) - ) - Block("1660:l00000791", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000008bd", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000088c", condition()) - ) - ) - Block("1700:l0000088c", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000089f", condition()) - ) - ) - Block("1720:l000007cd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000089f", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_assign_assign/clang_pic/basic_assign_assign-before-analysis.il.expected b/src/test/correct/basic_assign_assign/clang_pic/basic_assign_assign-before-analysis.il.expected deleted file mode 100644 index 96265d4b8..000000000 --- a/src/test/correct/basic_assign_assign/clang_pic/basic_assign_assign-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000002e5", condition()) - ) - ) - Block("1816:l000002e5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) - ), - jumps( - GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000030c", condition()) - ) - ) - Block("1828:l0000030c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l000002f3", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000002ff", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l00000299", condition()) - ) - ) - Block("1852:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1900:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l00000493", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l0000053d", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000035c", condition()) - ) - ) - Block("1668:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000035c", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000033e", condition()) - ) - ) - Block("1704:l0000033e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000351", condition()) - ) - ) - Block("1724:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000351", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4040bv64)])) - LocalAssign(Register(R8, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000320", condition()) - ) - ) - Block("1764:l00000320", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000333", condition()) - ) - ) - Block("1784:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000333", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_assign_assign/gcc/basic_assign_assign-before-analysis.il.expected b/src/test/correct/basic_assign_assign/gcc/basic_assign_assign-before-analysis.il.expected deleted file mode 100644 index fca0ff5bf..000000000 --- a/src/test/correct/basic_assign_assign/gcc/basic_assign_assign-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002e4", condition()) - ) - ) - Block("1752:l000002e4", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000002f2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000030b", condition()) - ) - ) - Block("1764:l0000030b", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002f2", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002fe", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000299", condition()) - ) - ) - Block("1788:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004e4", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000058e", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000035b", condition()) - ) - ) - Block("1604:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000035b", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000033d", condition()) - ) - ) - Block("1640:l0000033d", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000350", condition()) - ) - ) - Block("1660:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000350", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000031f", condition()) - ) - ) - Block("1700:l0000031f", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000332", condition()) - ) - ) - Block("1720:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000332", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_assign_assign/gcc_O2/basic_assign_assign-before-analysis.il.expected b/src/test/correct/basic_assign_assign/gcc_O2/basic_assign_assign-before-analysis.il.expected deleted file mode 100644 index 40a431627..000000000 --- a/src/test/correct/basic_assign_assign/gcc_O2/basic_assign_assign-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f3", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000031c", condition()) - ) - ) - Block("1816:l0000031c", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000032a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000343", condition()) - ) - ) - Block("1828:l00000343", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000032a", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000336", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f3", condition()) - ) - ) - Block("1852:l000002f3", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l00000526", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l0000021d", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005da", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000233", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000393", condition()) - ) - ) - Block("1668:l00000233", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000393", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000375", condition()) - ) - ) - Block("1704:l00000375", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000388", condition()) - ) - ) - Block("1724:l00000278", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000388", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R2, bv64) := 5bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R2, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000357", condition()) - ) - ) - Block("1764:l00000357", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000036a", condition()) - ) - ) - Block("1784:l000002b4", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000036a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_assign_assign/gcc_no_plt_no_pic/basic_assign_assign-before-analysis.il.expected b/src/test/correct/basic_assign_assign/gcc_no_plt_no_pic/basic_assign_assign-before-analysis.il.expected deleted file mode 100644 index 0d3942cca..000000000 --- a/src/test/correct/basic_assign_assign/gcc_no_plt_no_pic/basic_assign_assign-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000081c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000867", condition()) - ) - ) - Block("1752:l00000867", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000088e", condition()) - ) - ) - Block("1764:l0000088e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000875", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000881", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000081c", condition()) - ) - ) - Block("1788:l0000081c", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000a67", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000746", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000aef", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l0000075c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000008de", condition()) - ) - ) - Block("1604:l0000075c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000008de", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000008c0", condition()) - ) - ) - Block("1640:l000008c0", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000008d3", condition()) - ) - ) - Block("1660:l000007a1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000008d3", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000008a2", condition()) - ) - ) - Block("1700:l000008a2", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000008b5", condition()) - ) - ) - Block("1720:l000007dd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000008b5", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_assign_assign/gcc_pic/basic_assign_assign-before-analysis.il.expected b/src/test/correct/basic_assign_assign/gcc_pic/basic_assign_assign-before-analysis.il.expected deleted file mode 100644 index 63a483b36..000000000 --- a/src/test/correct/basic_assign_assign/gcc_pic/basic_assign_assign-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000002e5", condition()) - ) - ) - Block("1816:l000002e5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - ), - jumps( - GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000030c", condition()) - ) - ) - Block("1828:l0000030c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l000002f3", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000002ff", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l00000299", condition()) - ) - ) - Block("1852:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1900:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l00000493", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l0000053d", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000035c", condition()) - ) - ) - Block("1668:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000035c", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000033e", condition()) - ) - ) - Block("1704:l0000033e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000351", condition()) - ) - ) - Block("1724:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000351", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R1, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000320", condition()) - ) - ) - Block("1764:l00000320", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000333", condition()) - ) - ) - Block("1784:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000333", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_assign_increment/clang/basic_assign_increment-before-analysis.il.expected b/src/test/correct/basic_assign_increment/clang/basic_assign_increment-before-analysis.il.expected deleted file mode 100644 index 745874097..000000000 --- a/src/test/correct/basic_assign_increment/clang/basic_assign_increment-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002e6", condition()) - ) - ) - Block("1752:l000002e6", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002f4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000030d", condition()) - ) - ) - Block("1764:l0000030d", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002f4", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000300", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000299", condition()) - ) - ) - Block("1788:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004e6", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000590", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000035d", condition()) - ) - ) - Block("1604:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000035d", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000033f", condition()) - ) - ) - Block("1640:l0000033f", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000352", condition()) - ) - ) - Block("1660:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000352", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000321", condition()) - ) - ) - Block("1700:l00000321", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000334", condition()) - ) - ) - Block("1720:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000334", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_assign_increment/clang_O2/basic_assign_increment-before-analysis.il.expected b/src/test/correct/basic_assign_increment/clang_O2/basic_assign_increment-before-analysis.il.expected deleted file mode 100644 index 6175f2547..000000000 --- a/src/test/correct/basic_assign_increment/clang_O2/basic_assign_increment-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002e6", condition()) - ) - ) - Block("1752:l000002e6", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002f4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000030d", condition()) - ) - ) - Block("1764:l0000030d", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002f4", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000300", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000299", condition()) - ) - ) - Block("1788:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004e6", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000590", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000035d", condition()) - ) - ) - Block("1604:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000035d", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000033f", condition()) - ) - ) - Block("1640:l0000033f", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000352", condition()) - ) - ) - Block("1660:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000352", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(Register(R9, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R9, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000321", condition()) - ) - ) - Block("1700:l00000321", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000334", condition()) - ) - ) - Block("1720:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000334", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_assign_increment/clang_no_plt_no_pic/basic_assign_increment-before-analysis.il.expected b/src/test/correct/basic_assign_increment/clang_no_plt_no_pic/basic_assign_increment-before-analysis.il.expected deleted file mode 100644 index 03ca075b4..000000000 --- a/src/test/correct/basic_assign_increment/clang_no_plt_no_pic/basic_assign_increment-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000081e", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000086b", condition()) - ) - ) - Block("1752:l0000086b", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000879", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000892", condition()) - ) - ) - Block("1764:l00000892", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000879", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000885", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000081e", condition()) - ) - ) - Block("1788:l0000081e", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000a6b", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000748", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000af3", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000075e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000008e2", condition()) - ) - ) - Block("1604:l0000075e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000008e2", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000007a3", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000008c4", condition()) - ) - ) - Block("1640:l000008c4", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l000007a3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000008d7", condition()) - ) - ) - Block("1660:l000007a3", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000008d7", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000007df", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000008a6", condition()) - ) - ) - Block("1700:l000008a6", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000007df", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000008b9", condition()) - ) - ) - Block("1720:l000007df", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000008b9", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_assign_increment/clang_pic/basic_assign_increment-before-analysis.il.expected b/src/test/correct/basic_assign_increment/clang_pic/basic_assign_increment-before-analysis.il.expected deleted file mode 100644 index 8faec5e6c..000000000 --- a/src/test/correct/basic_assign_increment/clang_pic/basic_assign_increment-before-analysis.il.expected +++ /dev/null @@ -1,307 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000002f1", condition()) - ) - ) - Block("1816:l000002f1", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) - ), - jumps( - GoTo("1840:l000002ff", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000318", condition()) - ) - ) - Block("1828:l00000318", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l000002ff", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000030b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l0000029d", condition()) - ) - ) - Block("1852:l0000029d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1904:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1904:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l0000049f", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001c7", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l0000054a", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000368", condition()) - ) - ) - Block("1668:l000001dd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000368", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000034a", condition()) - ) - ) - Block("1704:l0000034a", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) - ), - jumps( - GoTo("1724:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l0000035d", condition()) - ) - ) - Block("1724:l00000222", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l0000035d", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4040bv64)])) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R9, bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000032c", condition()) - ) - ) - Block("1764:l0000032c", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000033f", condition()) - ) - ) - Block("1784:l0000025e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000033f", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_assign_increment/gcc/basic_assign_increment-before-analysis.il.expected b/src/test/correct/basic_assign_increment/gcc/basic_assign_increment-before-analysis.il.expected deleted file mode 100644 index d942c4643..000000000 --- a/src/test/correct/basic_assign_increment/gcc/basic_assign_increment-before-analysis.il.expected +++ /dev/null @@ -1,309 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000303", condition()) - ) - ) - Block("1752:l00000303", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000311", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000032a", condition()) - ) - ) - Block("1764:l0000032a", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000311", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000031d", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002a5", condition()) - ) - ) - Block("1788:l000002a5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1848:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000506", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001cf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005b3", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000037a", condition()) - ) - ) - Block("1604:l000001e5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000037a", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000035c", condition()) - ) - ) - Block("1640:l0000035c", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000036f", condition()) - ) - ) - Block("1660:l0000022a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000036f", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000033e", condition()) - ) - ) - Block("1700:l0000033e", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000351", condition()) - ) - ) - Block("1720:l00000266", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000351", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_assign_increment/gcc_O2/basic_assign_increment-before-analysis.il.expected b/src/test/correct/basic_assign_increment/gcc_O2/basic_assign_increment-before-analysis.il.expected deleted file mode 100644 index 7bf4d0eee..000000000 --- a/src/test/correct/basic_assign_increment/gcc_O2/basic_assign_increment-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000322", condition()) - ) - ) - Block("1816:l00000322", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l00000330", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000349", condition()) - ) - ) - Block("1828:l00000349", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000330", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000033c", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f9", condition()) - ) - ) - Block("1852:l000002f9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l0000052c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000223", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005e0", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000239", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000399", condition()) - ) - ) - Block("1668:l00000239", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000399", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000037b", condition()) - ) - ) - Block("1704:l0000037b", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l0000038e", condition()) - ) - ) - Block("1724:l0000027e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l0000038e", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R2, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 20bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R1, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R2, bv64), 20bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000035d", condition()) - ) - ) - Block("1764:l0000035d", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000370", condition()) - ) - ) - Block("1784:l000002ba", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000370", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_assign_increment/gcc_no_plt_no_pic/basic_assign_increment-before-analysis.il.expected b/src/test/correct/basic_assign_increment/gcc_no_plt_no_pic/basic_assign_increment-before-analysis.il.expected deleted file mode 100644 index 619da9a78..000000000 --- a/src/test/correct/basic_assign_increment/gcc_no_plt_no_pic/basic_assign_increment-before-analysis.il.expected +++ /dev/null @@ -1,309 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000084d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000008ab", condition()) - ) - ) - Block("1752:l000008ab", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000008b9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000008d2", condition()) - ) - ) - Block("1764:l000008d2", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000008b9", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000008c5", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000084d", condition()) - ) - ) - Block("1788:l0000084d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1848:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000aae", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000777", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000b39", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l0000078d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000922", condition()) - ) - ) - Block("1604:l0000078d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000922", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000007d2", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000904", condition()) - ) - ) - Block("1640:l00000904", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l000007d2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000917", condition()) - ) - ) - Block("1660:l000007d2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000917", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000080e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000008e6", condition()) - ) - ) - Block("1700:l000008e6", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000080e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000008f9", condition()) - ) - ) - Block("1720:l0000080e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000008f9", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_assign_increment/gcc_pic/basic_assign_increment-before-analysis.il.expected b/src/test/correct/basic_assign_increment/gcc_pic/basic_assign_increment-before-analysis.il.expected deleted file mode 100644 index 5b65dd499..000000000 --- a/src/test/correct/basic_assign_increment/gcc_pic/basic_assign_increment-before-analysis.il.expected +++ /dev/null @@ -1,309 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000305", condition()) - ) - ) - Block("1816:l00000305", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - ), - jumps( - GoTo("1840:l00000313", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000032c", condition()) - ) - ) - Block("1828:l0000032c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000313", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000031f", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002a5", condition()) - ) - ) - Block("1852:l000002a5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1912:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1912:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l000004b3", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001cf", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l00000560", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000037c", condition()) - ) - ) - Block("1668:l000001e5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000037c", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000035e", condition()) - ) - ) - Block("1704:l0000035e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) - ), - jumps( - GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000371", condition()) - ) - ) - Block("1724:l0000022a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000371", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000340", condition()) - ) - ) - Block("1764:l00000340", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000353", condition()) - ) - ) - Block("1784:l00000266", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000353", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_function_call_caller/clang/basic_function_call_caller-before-analysis.il.expected b/src/test/correct/basic_function_call_caller/clang/basic_function_call_caller-before-analysis.il.expected deleted file mode 100644 index 522d30df5..000000000 --- a/src/test/correct/basic_function_call_caller/clang/basic_function_call_caller-before-analysis.il.expected +++ /dev/null @@ -1,335 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002c1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000362", condition()) - ) - ) - Block("1752:l00000362", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000370", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000389", condition()) - ) - ) - Block("1764:l00000389", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000370", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000037c", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002c1", condition()) - ) - ) - Block("1788:l000002c1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l0000056c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001eb", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000622", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000201", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003d9", condition()) - ) - ) - Block("1604:l00000201", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003d9", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003bb", condition()) - ) - ) - Block("1640:l000003bb", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003ce", condition()) - ) - ) - Block("1660:l00000246", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003ce", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1820:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1820:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1812:zero", condition()) - ) - ) - Block("1840:l00000321", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)]), 32)) - LocalAssign(Register(R9, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000039d", condition()) - ) - ) - Block("1700:l0000039d", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003b0", condition()) - ) - ) - Block("1720:l00000282", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003b0", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1812:zero", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1812:lzero", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_function_call_caller/clang_O2/basic_function_call_caller-before-analysis.il.expected b/src/test/correct/basic_function_call_caller/clang_O2/basic_function_call_caller-before-analysis.il.expected deleted file mode 100644 index bbeb26f15..000000000 --- a/src/test/correct/basic_function_call_caller/clang_O2/basic_function_call_caller-before-analysis.il.expected +++ /dev/null @@ -1,317 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000301", condition()) - ) - ) - Block("1752:l00000301", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000030f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000328", condition()) - ) - ) - Block("1764:l00000328", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000030f", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000031b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002a5", condition()) - ) - ) - Block("1788:l000002a5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1848:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000504", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001cf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005b3", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000378", condition()) - ) - ) - Block("1604:l000001e5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000378", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000035a", condition()) - ) - ) - Block("1640:l0000035a", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000036d", condition()) - ) - ) - Block("1660:l0000022a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000036d", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1820:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1820:lmain", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R10, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R10, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000033c", condition()) - ) - ) - Block("1700:l0000033c", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000034f", condition()) - ) - ) - Block("1720:l00000266", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000034f", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1812:zero", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1812:lzero", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_function_call_caller/clang_no_plt_no_pic/basic_function_call_caller-before-analysis.il.expected b/src/test/correct/basic_function_call_caller/clang_no_plt_no_pic/basic_function_call_caller-before-analysis.il.expected deleted file mode 100644 index 50f29a019..000000000 --- a/src/test/correct/basic_function_call_caller/clang_no_plt_no_pic/basic_function_call_caller-before-analysis.il.expected +++ /dev/null @@ -1,335 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008d8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000979", condition()) - ) - ) - Block("1752:l00000979", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000987", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009a0", condition()) - ) - ) - Block("1764:l000009a0", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000987", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000993", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008d8", condition()) - ) - ) - Block("1788:l000008d8", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b83", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000802", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c15", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000818", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000009f0", condition()) - ) - ) - Block("1604:l00000818", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000009f0", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009d2", condition()) - ) - ) - Block("1640:l000009d2", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009e5", condition()) - ) - ) - Block("1660:l0000085d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009e5", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1820:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1820:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1812:zero", condition()) - ) - ) - Block("1840:l00000938", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)]), 32)) - LocalAssign(Register(R9, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000899", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009b4", condition()) - ) - ) - Block("1700:l000009b4", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000899", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009c7", condition()) - ) - ) - Block("1720:l00000899", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009c7", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1812:zero", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1812:lzero", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_function_call_caller/clang_pic/basic_function_call_caller-before-analysis.il.expected b/src/test/correct/basic_function_call_caller/clang_pic/basic_function_call_caller-before-analysis.il.expected deleted file mode 100644 index 13f46bf3a..000000000 --- a/src/test/correct/basic_function_call_caller/clang_pic/basic_function_call_caller-before-analysis.il.expected +++ /dev/null @@ -1,337 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002c9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000378", condition()) - ) - ) - Block("1816:l00000378", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) - ), - jumps( - GoTo("1840:l00000386", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000039f", condition()) - ) - ) - Block("1828:l0000039f", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000386", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000392", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002c9", condition()) - ) - ) - Block("1852:l000002c9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1948:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1948:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l00000526", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001f3", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l000005c5", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1668:l00000209", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003ef", condition()) - ) - ) - Block("1668:l00000209", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003ef", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003d1", condition()) - ) - ) - Block("1704:l000003d1", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) - ), - jumps( - GoTo("1724:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003e4", condition()) - ) - ) - Block("1724:l0000024e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003e4", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1884:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1884:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 1904bv64) - ), - jumps( - DirectCall("1876:zero", condition()) - ) - ) - Block("1904:l00000329", - statements( - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)]), 32)) - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4048bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003b3", condition()) - ) - ) - Block("1764:l000003b3", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003c6", condition()) - ) - ) - Block("1784:l0000028a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003c6", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1876:zero", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:lzero", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_function_call_caller/gcc/basic_function_call_caller-before-analysis.il.expected b/src/test/correct/basic_function_call_caller/gcc/basic_function_call_caller-before-analysis.il.expected deleted file mode 100644 index 42dc02325..000000000 --- a/src/test/correct/basic_function_call_caller/gcc/basic_function_call_caller-before-analysis.il.expected +++ /dev/null @@ -1,337 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000370", condition()) - ) - ) - Block("1752:l00000370", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l0000037e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000397", condition()) - ) - ) - Block("1764:l00000397", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000037e", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000038a", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002c5", condition()) - ) - ) - Block("1788:l000002c5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1880:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1880:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l0000057b", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001ef", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000632", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003e7", condition()) - ) - ) - Block("1604:l00000205", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003e7", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003c9", condition()) - ) - ) - Block("1640:l000003c9", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003dc", condition()) - ) - ) - Block("1660:l0000024a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003dc", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1820:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1820:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 1836bv64) - ), - jumps( - DirectCall("1812:zero", condition()) - ) - ) - Block("1836:l00000323", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003ab", condition()) - ) - ) - Block("1700:l000003ab", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003be", condition()) - ) - ) - Block("1720:l00000286", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003be", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1812:zero", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1812:lzero", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_function_call_caller/gcc_O2/basic_function_call_caller-before-analysis.il.expected b/src/test/correct/basic_function_call_caller/gcc_O2/basic_function_call_caller-before-analysis.il.expected deleted file mode 100644 index 0d1e3357c..000000000 --- a/src/test/correct/basic_function_call_caller/gcc_O2/basic_function_call_caller-before-analysis.il.expected +++ /dev/null @@ -1,317 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l00000311", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000034a", condition()) - ) - ) - Block("1816:l0000034a", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l00000358", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000371", condition()) - ) - ) - Block("1828:l00000371", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000358", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000364", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l00000311", condition()) - ) - ) - Block("1852:l00000311", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1896:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l00000559", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l0000023b", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000614", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000251", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003c1", condition()) - ) - ) - Block("1668:l00000251", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003c1", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003a3", condition()) - ) - ) - Block("1704:l000003a3", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003b6", condition()) - ) - ) - Block("1724:l00000296", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003b6", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) - LocalAssign(Register(R3, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R2, bv64), 4bv64)] := Extract(Register(R3, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002d2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000385", condition()) - ) - ) - Block("1764:l00000385", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002d2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000398", condition()) - ) - ) - Block("1784:l000002d2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000398", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1888:zero", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1888:lzero", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_function_call_caller/gcc_no_plt_no_pic/basic_function_call_caller-before-analysis.il.expected b/src/test/correct/basic_function_call_caller/gcc_no_plt_no_pic/basic_function_call_caller-before-analysis.il.expected deleted file mode 100644 index 70876d0cc..000000000 --- a/src/test/correct/basic_function_call_caller/gcc_no_plt_no_pic/basic_function_call_caller-before-analysis.il.expected +++ /dev/null @@ -1,337 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008ec", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000997", condition()) - ) - ) - Block("1752:l00000997", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000009a5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009be", condition()) - ) - ) - Block("1764:l000009be", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000009a5", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009b1", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008ec", condition()) - ) - ) - Block("1788:l000008ec", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1880:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1880:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000ba2", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000816", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c35", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l0000082c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a0e", condition()) - ) - ) - Block("1604:l0000082c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a0e", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000871", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009f0", condition()) - ) - ) - Block("1640:l000009f0", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000871", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a03", condition()) - ) - ) - Block("1660:l00000871", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a03", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1820:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1820:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 1836bv64) - ), - jumps( - DirectCall("1812:zero", condition()) - ) - ) - Block("1836:l0000094a", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008ad", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009d2", condition()) - ) - ) - Block("1700:l000009d2", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000008ad", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009e5", condition()) - ) - ) - Block("1720:l000008ad", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009e5", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1812:zero", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1812:lzero", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_function_call_caller/gcc_pic/basic_function_call_caller-before-analysis.il.expected b/src/test/correct/basic_function_call_caller/gcc_pic/basic_function_call_caller-before-analysis.il.expected deleted file mode 100644 index f58471812..000000000 --- a/src/test/correct/basic_function_call_caller/gcc_pic/basic_function_call_caller-before-analysis.il.expected +++ /dev/null @@ -1,337 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000372", condition()) - ) - ) - Block("1816:l00000372", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1840:l00000380", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000399", condition()) - ) - ) - Block("1828:l00000399", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000380", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000038c", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002c5", condition()) - ) - ) - Block("1852:l000002c5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1944:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l00000520", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001ef", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l000005be", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003e9", condition()) - ) - ) - Block("1668:l00000205", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003e9", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003cb", condition()) - ) - ) - Block("1704:l000003cb", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003de", condition()) - ) - ) - Block("1724:l0000024a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003de", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1884:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1884:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 1900bv64) - ), - jumps( - DirectCall("1876:zero", condition()) - ) - ) - Block("1900:l00000323", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003ad", condition()) - ) - ) - Block("1764:l000003ad", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003c0", condition()) - ) - ) - Block("1784:l00000286", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003c0", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1876:zero", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:lzero", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_function_call_reader/clang/basic_function_call_reader-before-analysis.il.expected b/src/test/correct/basic_function_call_reader/clang/basic_function_call_reader-before-analysis.il.expected deleted file mode 100644 index c042eecd7..000000000 --- a/src/test/correct/basic_function_call_reader/clang/basic_function_call_reader-before-analysis.il.expected +++ /dev/null @@ -1,372 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002cd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000389", condition()) - ) - ) - Block("1752:l00000389", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000397", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003b0", condition()) - ) - ) - Block("1764:l000003b0", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000397", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000003a3", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002cd", condition()) - ) - ) - Block("1788:l000002cd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1888:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1888:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000596", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001f7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000064e", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000020d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000400", condition()) - ) - ) - Block("1604:l0000020d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000400", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003e2", condition()) - ) - ) - Block("1640:l000003e2", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003f5", condition()) - ) - ) - Block("1660:l00000252", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003f5", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000342", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000345", condition()) - ) - ) - Block("?:l00000345", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000348", condition()) - ) - ) - Block("?:l00000342", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000348", condition()) - ) - ) - Block("?:l00000348", - statements( - ), - jumps( - GoTo("1864:l00000350", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1852:l0000037a", condition()) - ) - ) - Block("1864:l00000350", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1876:l00000365", condition()) - ) - ) - Block("1852:l0000037a", - statements( - ), - jumps( - GoTo("1856:l0000037b", condition()) - ) - ) - Block("1856:l0000037b", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - ), - jumps( - GoTo("1876:l00000365", condition()) - ) - ) - Block("1876:l00000365", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003c4", condition()) - ) - ) - Block("1700:l000003c4", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003d7", condition()) - ) - ) - Block("1720:l0000028e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003d7", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_function_call_reader/clang_O2/basic_function_call_reader-before-analysis.il.expected b/src/test/correct/basic_function_call_reader/clang_O2/basic_function_call_reader-before-analysis.il.expected deleted file mode 100644 index d3af82e52..000000000 --- a/src/test/correct/basic_function_call_reader/clang_O2/basic_function_call_reader-before-analysis.il.expected +++ /dev/null @@ -1,334 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000030b", condition()) - ) - ) - Block("1752:l0000030b", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000319", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000332", condition()) - ) - ) - Block("1764:l00000332", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000319", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000325", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000029d", condition()) - ) - ) - Block("1788:l0000029d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1840:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l0000050c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005b7", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000382", condition()) - ) - ) - Block("1604:l000001dd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000382", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000364", condition()) - ) - ) - Block("1640:l00000364", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000377", condition()) - ) - ) - Block("1660:l00000222", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000377", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("?:l000002f9", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l000002fd", condition()) - ) - ) - Block("?:l000002fd", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(Extract(Register(R9, bv64)[32:0]), 32)) - ), - jumps( - GoTo("?:l00000300", condition()) - ) - ) - Block("?:l000002f9", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000300", condition()) - ) - ) - Block("?:l00000300", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000346", condition()) - ) - ) - Block("1700:l00000346", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000359", condition()) - ) - ) - Block("1720:l0000025e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000359", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_function_call_reader/clang_no_plt_no_pic/basic_function_call_reader-before-analysis.il.expected b/src/test/correct/basic_function_call_reader/clang_no_plt_no_pic/basic_function_call_reader-before-analysis.il.expected deleted file mode 100644 index e3ec18803..000000000 --- a/src/test/correct/basic_function_call_reader/clang_no_plt_no_pic/basic_function_call_reader-before-analysis.il.expected +++ /dev/null @@ -1,372 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000910", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000009cc", condition()) - ) - ) - Block("1752:l000009cc", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000009da", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009f3", condition()) - ) - ) - Block("1764:l000009f3", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000009da", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009e6", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000910", condition()) - ) - ) - Block("1788:l00000910", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1888:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1888:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000bd9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000083a", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c6e", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000850", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a43", condition()) - ) - ) - Block("1604:l00000850", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a43", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000895", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000a25", condition()) - ) - ) - Block("1640:l00000a25", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000895", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a38", condition()) - ) - ) - Block("1660:l00000895", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a38", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000985", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000988", condition()) - ) - ) - Block("?:l00000988", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l0000098b", condition()) - ) - ) - Block("?:l00000985", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l0000098b", condition()) - ) - ) - Block("?:l0000098b", - statements( - ), - jumps( - GoTo("1864:l00000993", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1852:l000009bd", condition()) - ) - ) - Block("1864:l00000993", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1876:l000009a8", condition()) - ) - ) - Block("1852:l000009bd", - statements( - ), - jumps( - GoTo("1856:l000009be", condition()) - ) - ) - Block("1856:l000009be", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - ), - jumps( - GoTo("1876:l000009a8", condition()) - ) - ) - Block("1876:l000009a8", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000a07", condition()) - ) - ) - Block("1700:l00000a07", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000008d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000a1a", condition()) - ) - ) - Block("1720:l000008d1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000a1a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_function_call_reader/clang_pic/basic_function_call_reader-before-analysis.il.expected b/src/test/correct/basic_function_call_reader/clang_pic/basic_function_call_reader-before-analysis.il.expected deleted file mode 100644 index 75641545a..000000000 --- a/src/test/correct/basic_function_call_reader/clang_pic/basic_function_call_reader-before-analysis.il.expected +++ /dev/null @@ -1,374 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000039f", condition()) - ) - ) - Block("1816:l0000039f", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) - ), - jumps( - GoTo("1840:l000003ad", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l000003c6", condition()) - ) - ) - Block("1828:l000003c6", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l000003ad", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000003b9", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002d5", condition()) - ) - ) - Block("1852:l000002d5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1960:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1960:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l0000054d", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001ff", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l000005ee", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1668:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000416", condition()) - ) - ) - Block("1668:l00000215", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000416", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003f8", condition()) - ) - ) - Block("1704:l000003f8", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) - ), - jumps( - GoTo("1724:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l0000040b", condition()) - ) - ) - Block("1724:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l0000040b", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4048bv64)])) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000358", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l0000035b", condition()) - ) - ) - Block("?:l0000035b", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l0000035e", condition()) - ) - ) - Block("?:l00000358", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l0000035e", condition()) - ) - ) - Block("?:l0000035e", - statements( - ), - jumps( - GoTo("1936:l00000366", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1924:l00000390", condition()) - ) - ) - Block("1936:l00000366", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1948:l0000037b", condition()) - ) - ) - Block("1924:l00000390", - statements( - ), - jumps( - GoTo("1928:l00000391", condition()) - ) - ) - Block("1928:l00000391", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - ), - jumps( - GoTo("1948:l0000037b", condition()) - ) - ) - Block("1948:l0000037b", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003da", condition()) - ) - ) - Block("1764:l000003da", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003ed", condition()) - ) - ) - Block("1784:l00000296", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003ed", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_function_call_reader/gcc/basic_function_call_reader-before-analysis.il.expected b/src/test/correct/basic_function_call_reader/gcc/basic_function_call_reader-before-analysis.il.expected deleted file mode 100644 index 18dd59731..000000000 --- a/src/test/correct/basic_function_call_reader/gcc/basic_function_call_reader-before-analysis.il.expected +++ /dev/null @@ -1,339 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000352", condition()) - ) - ) - Block("1752:l00000352", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000360", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000379", condition()) - ) - ) - Block("1764:l00000379", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000360", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000036c", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002bd", condition()) - ) - ) - Block("1788:l000002bd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l0000055b", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001e7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000610", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003c9", condition()) - ) - ) - Block("1604:l000001fd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003c9", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003ab", condition()) - ) - ) - Block("1640:l000003ab", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003be", condition()) - ) - ) - Block("1660:l00000242", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003be", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1860:l00000332", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1852:l00000349", condition()) - ) - ) - Block("1860:l00000332", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - ), - jumps( - GoTo("1864:l0000033e", condition()) - ) - ) - Block("1852:l00000349", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - GoTo("1864:l0000033e", condition()) - ) - ) - Block("1864:l0000033e", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000038d", condition()) - ) - ) - Block("1700:l0000038d", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003a0", condition()) - ) - ) - Block("1720:l0000027e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003a0", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_function_call_reader/gcc_O2/basic_function_call_reader-before-analysis.il.expected b/src/test/correct/basic_function_call_reader/gcc_O2/basic_function_call_reader-before-analysis.il.expected deleted file mode 100644 index 33505dbdb..000000000 --- a/src/test/correct/basic_function_call_reader/gcc_O2/basic_function_call_reader-before-analysis.il.expected +++ /dev/null @@ -1,320 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f3", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000031c", condition()) - ) - ) - Block("1816:l0000031c", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000032a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000343", condition()) - ) - ) - Block("1828:l00000343", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000032a", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000336", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f3", condition()) - ) - ) - Block("1852:l000002f3", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l0000052d", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l0000021d", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005e3", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000233", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000393", condition()) - ) - ) - Block("1668:l00000233", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000393", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000375", condition()) - ) - ) - Block("1704:l00000375", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000388", condition()) - ) - ) - Block("1724:l00000278", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000388", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 20bv64)]), 32)) - ), - jumps( - GoTo("1556:l000001bc", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32), 0bv1))) - GoTo("1552:l00000398", condition()) - ) - ) - Block("1552:l00000398", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4bv64)]), 32)) - ), - jumps( - GoTo("1556:l000001bc", condition()) - ) - ) - Block("1556:l000001bc", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000357", condition()) - ) - ) - Block("1764:l00000357", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000036a", condition()) - ) - ) - Block("1784:l000002b4", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000036a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_function_call_reader/gcc_no_plt_no_pic/basic_function_call_reader-before-analysis.il.expected b/src/test/correct/basic_function_call_reader/gcc_no_plt_no_pic/basic_function_call_reader-before-analysis.il.expected deleted file mode 100644 index e7fb5e2d4..000000000 --- a/src/test/correct/basic_function_call_reader/gcc_no_plt_no_pic/basic_function_call_reader-before-analysis.il.expected +++ /dev/null @@ -1,339 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008c2", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000957", condition()) - ) - ) - Block("1752:l00000957", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000965", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000097e", condition()) - ) - ) - Block("1764:l0000097e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000965", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000971", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008c2", condition()) - ) - ) - Block("1788:l000008c2", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b60", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007ec", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000bf1", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000802", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000009ce", condition()) - ) - ) - Block("1604:l00000802", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000009ce", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000847", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009b0", condition()) - ) - ) - Block("1640:l000009b0", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000847", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009c3", condition()) - ) - ) - Block("1660:l00000847", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009c3", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1860:l00000937", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1852:l0000094e", condition()) - ) - ) - Block("1860:l00000937", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - ), - jumps( - GoTo("1864:l00000943", condition()) - ) - ) - Block("1852:l0000094e", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - GoTo("1864:l00000943", condition()) - ) - ) - Block("1864:l00000943", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000883", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000992", condition()) - ) - ) - Block("1700:l00000992", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000883", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009a5", condition()) - ) - ) - Block("1720:l00000883", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009a5", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_function_call_reader/gcc_pic/basic_function_call_reader-before-analysis.il.expected b/src/test/correct/basic_function_call_reader/gcc_pic/basic_function_call_reader-before-analysis.il.expected deleted file mode 100644 index ad10d013d..000000000 --- a/src/test/correct/basic_function_call_reader/gcc_pic/basic_function_call_reader-before-analysis.il.expected +++ /dev/null @@ -1,339 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000354", condition()) - ) - ) - Block("1816:l00000354", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1840:l00000362", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000037b", condition()) - ) - ) - Block("1828:l0000037b", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000362", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000036e", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002bd", condition()) - ) - ) - Block("1852:l000002bd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1936:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1936:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l00000502", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001e7", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l0000059e", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1668:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003cb", condition()) - ) - ) - Block("1668:l000001fd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003cb", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003ad", condition()) - ) - ) - Block("1704:l000003ad", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) - ), - jumps( - GoTo("1724:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003c0", condition()) - ) - ) - Block("1724:l00000242", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003c0", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1924:l00000334", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1916:l0000034b", condition()) - ) - ) - Block("1924:l00000334", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - ), - jumps( - GoTo("1928:l00000340", condition()) - ) - ) - Block("1916:l0000034b", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - GoTo("1928:l00000340", condition()) - ) - ) - Block("1928:l00000340", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000038f", condition()) - ) - ) - Block("1764:l0000038f", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003a2", condition()) - ) - ) - Block("1784:l0000027e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003a2", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_read/clang/basic_lock_read-before-analysis.il.expected b/src/test/correct/basic_lock_read/clang/basic_lock_read-before-analysis.il.expected deleted file mode 100644 index e4c47501d..000000000 --- a/src/test/correct/basic_lock_read/clang/basic_lock_read-before-analysis.il.expected +++ /dev/null @@ -1,364 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000375", condition()) - ) - ) - Block("1752:l00000375", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000383", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000039c", condition()) - ) - ) - Block("1764:l0000039c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000383", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000038f", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002c5", condition()) - ) - ) - Block("1788:l000002c5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1880:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1880:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000580", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001ef", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000636", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003ec", condition()) - ) - ) - Block("1604:l00000205", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003ec", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003ce", condition()) - ) - ) - Block("1640:l000003ce", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003e1", condition()) - ) - ) - Block("1660:l0000024a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003e1", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l0000032d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000330", condition()) - ) - ) - Block("?:l00000330", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000333", condition()) - ) - ) - Block("?:l0000032d", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000333", condition()) - ) - ) - Block("?:l00000333", - statements( - ), - jumps( - GoTo("1868:l0000033b", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1844:l00000352", condition()) - ) - ) - Block("1844:l00000352", - statements( - ), - jumps( - GoTo("1848:l00000353", condition()) - ) - ) - Block("1848:l00000353", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1868:l0000033b", condition()) - ) - ) - Block("1868:l0000033b", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003b0", condition()) - ) - ) - Block("1700:l000003b0", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003c3", condition()) - ) - ) - Block("1720:l00000286", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003c3", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_read/clang_O2/basic_lock_read-before-analysis.il.expected b/src/test/correct/basic_lock_read/clang_O2/basic_lock_read-before-analysis.il.expected deleted file mode 100644 index f0d04b48f..000000000 --- a/src/test/correct/basic_lock_read/clang_O2/basic_lock_read-before-analysis.il.expected +++ /dev/null @@ -1,322 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000301", condition()) - ) - ) - Block("1752:l00000301", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000030f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000328", condition()) - ) - ) - Block("1764:l00000328", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000030f", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000031b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002a5", condition()) - ) - ) - Block("1788:l000002a5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1848:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000504", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001cf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005b2", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000378", condition()) - ) - ) - Block("1604:l000001e5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000378", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000035a", condition()) - ) - ) - Block("1640:l0000035a", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000036d", condition()) - ) - ) - Block("1660:l0000022a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000036d", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - ), - jumps( - GoTo("1832:l000002dc", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[32:0]), 0bv32), 0bv1))) - GoTo("1824:l000002f7", condition()) - ) - ) - Block("1832:l000002dc", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1824:l000002f7", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000033c", condition()) - ) - ) - Block("1700:l0000033c", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000034f", condition()) - ) - ) - Block("1720:l00000266", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000034f", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_read/clang_no_plt_no_pic/basic_lock_read-before-analysis.il.expected b/src/test/correct/basic_lock_read/clang_no_plt_no_pic/basic_lock_read-before-analysis.il.expected deleted file mode 100644 index 99ef4c9fc..000000000 --- a/src/test/correct/basic_lock_read/clang_no_plt_no_pic/basic_lock_read-before-analysis.il.expected +++ /dev/null @@ -1,364 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008f0", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000009a0", condition()) - ) - ) - Block("1752:l000009a0", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000009ae", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009c7", condition()) - ) - ) - Block("1764:l000009c7", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000009ae", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009ba", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008f0", condition()) - ) - ) - Block("1788:l000008f0", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1880:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1880:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000bab", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000081a", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c3e", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000830", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a17", condition()) - ) - ) - Block("1604:l00000830", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a17", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009f9", condition()) - ) - ) - Block("1640:l000009f9", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a0c", condition()) - ) - ) - Block("1660:l00000875", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a0c", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000958", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l0000095b", condition()) - ) - ) - Block("?:l0000095b", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l0000095e", condition()) - ) - ) - Block("?:l00000958", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l0000095e", condition()) - ) - ) - Block("?:l0000095e", - statements( - ), - jumps( - GoTo("1868:l00000966", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1844:l0000097d", condition()) - ) - ) - Block("1844:l0000097d", - statements( - ), - jumps( - GoTo("1848:l0000097e", condition()) - ) - ) - Block("1848:l0000097e", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1868:l00000966", condition()) - ) - ) - Block("1868:l00000966", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008b1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009db", condition()) - ) - ) - Block("1700:l000009db", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000008b1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009ee", condition()) - ) - ) - Block("1720:l000008b1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009ee", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_read/clang_pic/basic_lock_read-before-analysis.il.expected b/src/test/correct/basic_lock_read/clang_pic/basic_lock_read-before-analysis.il.expected deleted file mode 100644 index d93af3faa..000000000 --- a/src/test/correct/basic_lock_read/clang_pic/basic_lock_read-before-analysis.il.expected +++ /dev/null @@ -1,366 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002cd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000038b", condition()) - ) - ) - Block("1816:l0000038b", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) - ), - jumps( - GoTo("1840:l00000399", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l000003b2", condition()) - ) - ) - Block("1828:l000003b2", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000399", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000003a5", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002cd", condition()) - ) - ) - Block("1852:l000002cd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1952:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1952:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l00000539", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001f7", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l000005d8", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l0000020d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000402", condition()) - ) - ) - Block("1668:l0000020d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000402", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003e4", condition()) - ) - ) - Block("1704:l000003e4", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) - ), - jumps( - GoTo("1724:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003f7", condition()) - ) - ) - Block("1724:l00000252", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003f7", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l0000033c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l0000033f", condition()) - ) - ) - Block("?:l0000033f", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000342", condition()) - ) - ) - Block("?:l0000033c", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000342", condition()) - ) - ) - Block("?:l00000342", - statements( - ), - jumps( - GoTo("1940:l0000034a", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1912:l00000361", condition()) - ) - ) - Block("1912:l00000361", - statements( - ), - jumps( - GoTo("1916:l00000362", condition()) - ) - ) - Block("1916:l00000362", - statements( - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4040bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1940:l0000034a", condition()) - ) - ) - Block("1940:l0000034a", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003c6", condition()) - ) - ) - Block("1764:l000003c6", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003d9", condition()) - ) - ) - Block("1784:l0000028e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003d9", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_read/gcc/basic_lock_read-before-analysis.il.expected b/src/test/correct/basic_lock_read/gcc/basic_lock_read-before-analysis.il.expected deleted file mode 100644 index 751904ef6..000000000 --- a/src/test/correct/basic_lock_read/gcc/basic_lock_read-before-analysis.il.expected +++ /dev/null @@ -1,335 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000036a", condition()) - ) - ) - Block("1752:l0000036a", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000378", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000391", condition()) - ) - ) - Block("1764:l00000391", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000378", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000384", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002c5", condition()) - ) - ) - Block("1788:l000002c5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1880:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1880:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000575", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001ef", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000062c", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003e1", condition()) - ) - ) - Block("1604:l00000205", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003e1", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003c3", condition()) - ) - ) - Block("1640:l000003c3", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003d6", condition()) - ) - ) - Block("1660:l0000024a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003d6", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1868:l00000327", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1840:l0000033e", condition()) - ) - ) - Block("1840:l0000033e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1868:l00000327", condition()) - ) - ) - Block("1868:l00000327", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003a5", condition()) - ) - ) - Block("1700:l000003a5", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003b8", condition()) - ) - ) - Block("1720:l00000286", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003b8", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_read/gcc_O2/basic_lock_read-before-analysis.il.expected b/src/test/correct/basic_lock_read/gcc_O2/basic_lock_read-before-analysis.il.expected deleted file mode 100644 index fa24d477f..000000000 --- a/src/test/correct/basic_lock_read/gcc_O2/basic_lock_read-before-analysis.il.expected +++ /dev/null @@ -1,321 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000320", condition()) - ) - ) - Block("1816:l00000320", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000032e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000347", condition()) - ) - ) - Block("1828:l00000347", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000032e", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000033a", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f7", condition()) - ) - ) - Block("1852:l000002f7", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l00000531", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000221", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005e7", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000237", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000397", condition()) - ) - ) - Block("1668:l00000237", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000397", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000027c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000379", condition()) - ) - ) - Block("1704:l00000379", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l0000027c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l0000038c", condition()) - ) - ) - Block("1724:l0000027c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l0000038c", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 20bv64)]), 32)) - ), - jumps( - GoTo("1556:l000001bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1552:l0000039c", condition()) - ) - ) - Block("1552:l0000039c", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 4bv64)] := 0bv32)) - ), - jumps( - GoTo("1556:l000001bd", condition()) - ) - ) - Block("1556:l000001bd", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002b8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000035b", condition()) - ) - ) - Block("1764:l0000035b", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002b8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000036e", condition()) - ) - ) - Block("1784:l000002b8", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000036e", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_read/gcc_no_plt_no_pic/basic_lock_read-before-analysis.il.expected b/src/test/correct/basic_lock_read/gcc_no_plt_no_pic/basic_lock_read-before-analysis.il.expected deleted file mode 100644 index 4ecd96e77..000000000 --- a/src/test/correct/basic_lock_read/gcc_no_plt_no_pic/basic_lock_read-before-analysis.il.expected +++ /dev/null @@ -1,335 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008e6", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000098b", condition()) - ) - ) - Block("1752:l0000098b", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000999", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009b2", condition()) - ) - ) - Block("1764:l000009b2", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000999", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009a5", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008e6", condition()) - ) - ) - Block("1788:l000008e6", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1880:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1880:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b96", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000810", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c29", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000826", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a02", condition()) - ) - ) - Block("1604:l00000826", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a02", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000086b", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009e4", condition()) - ) - ) - Block("1640:l000009e4", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000086b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009f7", condition()) - ) - ) - Block("1660:l0000086b", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009f7", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1868:l00000948", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1840:l0000095f", condition()) - ) - ) - Block("1840:l0000095f", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1868:l00000948", condition()) - ) - ) - Block("1868:l00000948", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008a7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009c6", condition()) - ) - ) - Block("1700:l000009c6", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000008a7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009d9", condition()) - ) - ) - Block("1720:l000008a7", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009d9", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_read/gcc_pic/basic_lock_read-before-analysis.il.expected b/src/test/correct/basic_lock_read/gcc_pic/basic_lock_read-before-analysis.il.expected deleted file mode 100644 index 4af95e143..000000000 --- a/src/test/correct/basic_lock_read/gcc_pic/basic_lock_read-before-analysis.il.expected +++ /dev/null @@ -1,335 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000036d", condition()) - ) - ) - Block("1816:l0000036d", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1840:l0000037b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000394", condition()) - ) - ) - Block("1828:l00000394", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000037b", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000387", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002c5", condition()) - ) - ) - Block("1852:l000002c5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1944:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l0000051b", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001ef", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l000005b9", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003e4", condition()) - ) - ) - Block("1668:l00000205", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003e4", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003c6", condition()) - ) - ) - Block("1704:l000003c6", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003d9", condition()) - ) - ) - Block("1724:l0000024a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003d9", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1932:l00000328", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1904:l0000033f", condition()) - ) - ) - Block("1904:l0000033f", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1932:l00000328", condition()) - ) - ) - Block("1932:l00000328", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003a8", condition()) - ) - ) - Block("1764:l000003a8", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003bb", condition()) - ) - ) - Block("1784:l00000286", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003bb", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_security_read/clang/basic_lock_security_read-before-analysis.il.expected b/src/test/correct/basic_lock_security_read/clang/basic_lock_security_read-before-analysis.il.expected deleted file mode 100644 index c1ed30212..000000000 --- a/src/test/correct/basic_lock_security_read/clang/basic_lock_security_read-before-analysis.il.expected +++ /dev/null @@ -1,363 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002c1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000036a", condition()) - ) - ) - Block("1752:l0000036a", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000378", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000391", condition()) - ) - ) - Block("1764:l00000391", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000378", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000384", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002c1", condition()) - ) - ) - Block("1788:l000002c1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000574", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001eb", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000629", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000201", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003e1", condition()) - ) - ) - Block("1604:l00000201", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003e1", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003c3", condition()) - ) - ) - Block("1640:l000003c3", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003d6", condition()) - ) - ) - Block("1660:l00000246", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003d6", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000329", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l0000032c", condition()) - ) - ) - Block("?:l0000032c", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l0000032f", condition()) - ) - ) - Block("?:l00000329", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l0000032f", condition()) - ) - ) - Block("?:l0000032f", - statements( - ), - jumps( - GoTo("1864:l00000337", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1844:l0000034e", condition()) - ) - ) - Block("1844:l0000034e", - statements( - ), - jumps( - GoTo("1848:l0000034f", condition()) - ) - ) - Block("1848:l0000034f", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1864:l00000337", condition()) - ) - ) - Block("1864:l00000337", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003a5", condition()) - ) - ) - Block("1700:l000003a5", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003b8", condition()) - ) - ) - Block("1720:l00000282", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003b8", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_security_read/clang_O2/basic_lock_security_read-before-analysis.il.expected b/src/test/correct/basic_lock_security_read/clang_O2/basic_lock_security_read-before-analysis.il.expected deleted file mode 100644 index c2250813b..000000000 --- a/src/test/correct/basic_lock_security_read/clang_O2/basic_lock_security_read-before-analysis.il.expected +++ /dev/null @@ -1,334 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000030b", condition()) - ) - ) - Block("1752:l0000030b", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000319", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000332", condition()) - ) - ) - Block("1764:l00000332", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000319", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000325", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000029d", condition()) - ) - ) - Block("1788:l0000029d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1840:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l0000050c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005b7", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000382", condition()) - ) - ) - Block("1604:l000001dd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000382", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000364", condition()) - ) - ) - Block("1640:l00000364", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000377", condition()) - ) - ) - Block("1660:l00000222", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000377", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 56bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("?:l000002fa", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l000002fd", condition()) - ) - ) - Block("?:l000002fd", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000300", condition()) - ) - ) - Block("?:l000002fa", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(Extract(Register(R9, bv64)[32:0]), 32)) - ), - jumps( - GoTo("?:l00000300", condition()) - ) - ) - Block("?:l00000300", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000346", condition()) - ) - ) - Block("1700:l00000346", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000359", condition()) - ) - ) - Block("1720:l0000025e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000359", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_security_read/clang_no_plt_no_pic/basic_lock_security_read-before-analysis.il.expected b/src/test/correct/basic_lock_security_read/clang_no_plt_no_pic/basic_lock_security_read-before-analysis.il.expected deleted file mode 100644 index fc7392c3a..000000000 --- a/src/test/correct/basic_lock_security_read/clang_no_plt_no_pic/basic_lock_security_read-before-analysis.il.expected +++ /dev/null @@ -1,363 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008df", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000988", condition()) - ) - ) - Block("1752:l00000988", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000996", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009af", condition()) - ) - ) - Block("1764:l000009af", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000996", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009a2", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008df", condition()) - ) - ) - Block("1788:l000008df", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b92", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000809", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c24", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000081f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000009ff", condition()) - ) - ) - Block("1604:l0000081f", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000009ff", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000864", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009e1", condition()) - ) - ) - Block("1640:l000009e1", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000864", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009f4", condition()) - ) - ) - Block("1660:l00000864", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009f4", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000947", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l0000094a", condition()) - ) - ) - Block("?:l0000094a", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l0000094d", condition()) - ) - ) - Block("?:l00000947", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l0000094d", condition()) - ) - ) - Block("?:l0000094d", - statements( - ), - jumps( - GoTo("1864:l00000955", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1844:l0000096c", condition()) - ) - ) - Block("1844:l0000096c", - statements( - ), - jumps( - GoTo("1848:l0000096d", condition()) - ) - ) - Block("1848:l0000096d", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1864:l00000955", condition()) - ) - ) - Block("1864:l00000955", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008a0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009c3", condition()) - ) - ) - Block("1700:l000009c3", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000008a0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009d6", condition()) - ) - ) - Block("1720:l000008a0", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009d6", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_security_read/clang_pic/basic_lock_security_read-before-analysis.il.expected b/src/test/correct/basic_lock_security_read/clang_pic/basic_lock_security_read-before-analysis.il.expected deleted file mode 100644 index 7ccc34122..000000000 --- a/src/test/correct/basic_lock_security_read/clang_pic/basic_lock_security_read-before-analysis.il.expected +++ /dev/null @@ -1,365 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002c9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000380", condition()) - ) - ) - Block("1816:l00000380", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) - ), - jumps( - GoTo("1840:l0000038e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l000003a7", condition()) - ) - ) - Block("1828:l000003a7", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000038e", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000039a", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002c9", condition()) - ) - ) - Block("1852:l000002c9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1948:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1948:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l0000052e", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001f3", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l000005cc", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l00000209", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003f7", condition()) - ) - ) - Block("1668:l00000209", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003f7", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003d9", condition()) - ) - ) - Block("1704:l000003d9", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) - ), - jumps( - GoTo("1724:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003ec", condition()) - ) - ) - Block("1724:l0000024e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003ec", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000338", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l0000033b", condition()) - ) - ) - Block("?:l0000033b", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l0000033e", condition()) - ) - ) - Block("?:l00000338", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l0000033e", condition()) - ) - ) - Block("?:l0000033e", - statements( - ), - jumps( - GoTo("1936:l00000346", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1912:l0000035d", condition()) - ) - ) - Block("1912:l0000035d", - statements( - ), - jumps( - GoTo("1916:l0000035e", condition()) - ) - ) - Block("1916:l0000035e", - statements( - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4040bv64)])) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1936:l00000346", condition()) - ) - ) - Block("1936:l00000346", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003bb", condition()) - ) - ) - Block("1764:l000003bb", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003ce", condition()) - ) - ) - Block("1784:l0000028a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003ce", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_security_read/gcc/basic_lock_security_read-before-analysis.il.expected b/src/test/correct/basic_lock_security_read/gcc/basic_lock_security_read-before-analysis.il.expected deleted file mode 100644 index 2c38f67d3..000000000 --- a/src/test/correct/basic_lock_security_read/gcc/basic_lock_security_read-before-analysis.il.expected +++ /dev/null @@ -1,332 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002b9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000034c", condition()) - ) - ) - Block("1752:l0000034c", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l0000035a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000373", condition()) - ) - ) - Block("1764:l00000373", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000035a", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000366", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002b9", condition()) - ) - ) - Block("1788:l000002b9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1868:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1868:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000554", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001e3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000608", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000001f9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003c3", condition()) - ) - ) - Block("1604:l000001f9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003c3", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003a5", condition()) - ) - ) - Block("1640:l000003a5", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003b8", condition()) - ) - ) - Block("1660:l0000023e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003b8", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1856:l0000031b", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1840:l00000332", condition()) - ) - ) - Block("1840:l00000332", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1856:l0000031b", condition()) - ) - ) - Block("1856:l0000031b", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000387", condition()) - ) - ) - Block("1700:l00000387", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000039a", condition()) - ) - ) - Block("1720:l0000027a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000039a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_security_read/gcc_O2/basic_lock_security_read-before-analysis.il.expected b/src/test/correct/basic_lock_security_read/gcc_O2/basic_lock_security_read-before-analysis.il.expected deleted file mode 100644 index 25a0e3431..000000000 --- a/src/test/correct/basic_lock_security_read/gcc_O2/basic_lock_security_read-before-analysis.il.expected +++ /dev/null @@ -1,321 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000320", condition()) - ) - ) - Block("1816:l00000320", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000032e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000347", condition()) - ) - ) - Block("1828:l00000347", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000032e", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000033a", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f7", condition()) - ) - ) - Block("1852:l000002f7", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l00000531", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000221", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005e7", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000237", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000397", condition()) - ) - ) - Block("1668:l00000237", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000397", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000027c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000379", condition()) - ) - ) - Block("1704:l00000379", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l0000027c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l0000038c", condition()) - ) - ) - Block("1724:l0000027c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l0000038c", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 20bv64)]), 32)) - ), - jumps( - GoTo("1560:l000001c2", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R1, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1556:l0000039c", condition()) - ) - ) - Block("1556:l0000039c", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4bv64)]), 32)) - ), - jumps( - GoTo("1560:l000001c2", condition()) - ) - ) - Block("1560:l000001c2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002b8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000035b", condition()) - ) - ) - Block("1764:l0000035b", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002b8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000036e", condition()) - ) - ) - Block("1784:l000002b8", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000036e", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_security_read/gcc_no_plt_no_pic/basic_lock_security_read-before-analysis.il.expected b/src/test/correct/basic_lock_security_read/gcc_no_plt_no_pic/basic_lock_security_read-before-analysis.il.expected deleted file mode 100644 index 895c9ec9b..000000000 --- a/src/test/correct/basic_lock_security_read/gcc_no_plt_no_pic/basic_lock_security_read-before-analysis.il.expected +++ /dev/null @@ -1,332 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008b6", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000949", condition()) - ) - ) - Block("1752:l00000949", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000957", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000970", condition()) - ) - ) - Block("1764:l00000970", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000957", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000963", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008b6", condition()) - ) - ) - Block("1788:l000008b6", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1868:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1868:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b51", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007e0", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000be1", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000007f6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000009c0", condition()) - ) - ) - Block("1604:l000007f6", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000009c0", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000083b", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009a2", condition()) - ) - ) - Block("1640:l000009a2", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000083b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009b5", condition()) - ) - ) - Block("1660:l0000083b", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009b5", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1856:l00000918", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1840:l0000092f", condition()) - ) - ) - Block("1840:l0000092f", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1856:l00000918", condition()) - ) - ) - Block("1856:l00000918", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000877", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000984", condition()) - ) - ) - Block("1700:l00000984", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000877", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000997", condition()) - ) - ) - Block("1720:l00000877", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000997", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_security_read/gcc_pic/basic_lock_security_read-before-analysis.il.expected b/src/test/correct/basic_lock_security_read/gcc_pic/basic_lock_security_read-before-analysis.il.expected deleted file mode 100644 index ea0f7d0bc..000000000 --- a/src/test/correct/basic_lock_security_read/gcc_pic/basic_lock_security_read-before-analysis.il.expected +++ /dev/null @@ -1,332 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002b9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000034e", condition()) - ) - ) - Block("1816:l0000034e", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1840:l0000035c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000375", condition()) - ) - ) - Block("1828:l00000375", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000035c", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000368", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002b9", condition()) - ) - ) - Block("1852:l000002b9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1932:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1932:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l000004fc", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001e3", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l00000597", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l000001f9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003c5", condition()) - ) - ) - Block("1668:l000001f9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003c5", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003a7", condition()) - ) - ) - Block("1704:l000003a7", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) - ), - jumps( - GoTo("1724:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003ba", condition()) - ) - ) - Block("1724:l0000023e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003ba", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1920:l0000031c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1904:l00000333", condition()) - ) - ) - Block("1904:l00000333", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1920:l0000031c", condition()) - ) - ) - Block("1920:l0000031c", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000389", condition()) - ) - ) - Block("1764:l00000389", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000039c", condition()) - ) - ) - Block("1784:l0000027a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000039c", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_security_write/clang/basic_lock_security_write-before-analysis.il.expected b/src/test/correct/basic_lock_security_write/clang/basic_lock_security_write-before-analysis.il.expected deleted file mode 100644 index 6c80d23e3..000000000 --- a/src/test/correct/basic_lock_security_write/clang/basic_lock_security_write-before-analysis.il.expected +++ /dev/null @@ -1,313 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002b5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000330", condition()) - ) - ) - Block("1752:l00000330", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000033e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000357", condition()) - ) - ) - Block("1764:l00000357", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000033e", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000034a", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002b5", condition()) - ) - ) - Block("1788:l000002b5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1864:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1864:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000537", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001df", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005e8", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001f5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003a7", condition()) - ) - ) - Block("1604:l000001f5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003a7", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000023a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000389", condition()) - ) - ) - Block("1640:l00000389", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000023a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000039c", condition()) - ) - ) - Block("1660:l0000023a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000039c", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R9, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R10, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := 0bv32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000036b", condition()) - ) - ) - Block("1700:l0000036b", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000037e", condition()) - ) - ) - Block("1720:l00000276", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000037e", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_security_write/clang_O2/basic_lock_security_write-before-analysis.il.expected b/src/test/correct/basic_lock_security_write/clang_O2/basic_lock_security_write-before-analysis.il.expected deleted file mode 100644 index f2519cbc4..000000000 --- a/src/test/correct/basic_lock_security_write/clang_O2/basic_lock_security_write-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002e4", condition()) - ) - ) - Block("1752:l000002e4", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002f2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000030b", condition()) - ) - ) - Block("1764:l0000030b", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002f2", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002fe", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000299", condition()) - ) - ) - Block("1788:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004e4", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000058e", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000035b", condition()) - ) - ) - Block("1604:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000035b", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000033d", condition()) - ) - ) - Block("1640:l0000033d", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000350", condition()) - ) - ) - Block("1660:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000350", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := 0bv32)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000031f", condition()) - ) - ) - Block("1700:l0000031f", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000332", condition()) - ) - ) - Block("1720:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000332", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_security_write/clang_no_plt_no_pic/basic_lock_security_write-before-analysis.il.expected b/src/test/correct/basic_lock_security_write/clang_no_plt_no_pic/basic_lock_security_write-before-analysis.il.expected deleted file mode 100644 index a1fe1e437..000000000 --- a/src/test/correct/basic_lock_security_write/clang_no_plt_no_pic/basic_lock_security_write-before-analysis.il.expected +++ /dev/null @@ -1,313 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000892", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000090d", condition()) - ) - ) - Block("1752:l0000090d", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000091b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000934", condition()) - ) - ) - Block("1764:l00000934", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000091b", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000927", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000892", condition()) - ) - ) - Block("1788:l00000892", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1864:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1864:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b14", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007bc", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000ba3", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000007d2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000984", condition()) - ) - ) - Block("1604:l000007d2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000984", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000817", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000966", condition()) - ) - ) - Block("1640:l00000966", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000817", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000979", condition()) - ) - ) - Block("1660:l00000817", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000979", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R9, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R10, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := 0bv32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000853", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000948", condition()) - ) - ) - Block("1700:l00000948", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000853", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000095b", condition()) - ) - ) - Block("1720:l00000853", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000095b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_security_write/clang_pic/basic_lock_security_write-before-analysis.il.expected b/src/test/correct/basic_lock_security_write/clang_pic/basic_lock_security_write-before-analysis.il.expected deleted file mode 100644 index c1011d277..000000000 --- a/src/test/correct/basic_lock_security_write/clang_pic/basic_lock_security_write-before-analysis.il.expected +++ /dev/null @@ -1,315 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000346", condition()) - ) - ) - Block("1816:l00000346", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) - ), - jumps( - GoTo("1840:l00000354", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000036d", condition()) - ) - ) - Block("1828:l0000036d", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000354", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000360", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002bd", condition()) - ) - ) - Block("1852:l000002bd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1936:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1936:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l000004f4", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001e7", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l0000058e", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003bd", condition()) - ) - ) - Block("1668:l000001fd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003bd", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000039f", condition()) - ) - ) - Block("1704:l0000039f", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) - ), - jumps( - GoTo("1724:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003b2", condition()) - ) - ) - Block("1724:l00000242", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003b2", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) - LocalAssign(Register(R9, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R9, bv64)[32:0]))) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4040bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R10, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := 0bv32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000381", condition()) - ) - ) - Block("1764:l00000381", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000394", condition()) - ) - ) - Block("1784:l0000027e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000394", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_security_write/gcc/basic_lock_security_write-before-analysis.il.expected b/src/test/correct/basic_lock_security_write/gcc/basic_lock_security_write-before-analysis.il.expected deleted file mode 100644 index 0318adc6a..000000000 --- a/src/test/correct/basic_lock_security_write/gcc/basic_lock_security_write-before-analysis.il.expected +++ /dev/null @@ -1,319 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002cd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000036a", condition()) - ) - ) - Block("1752:l0000036a", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000378", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000391", condition()) - ) - ) - Block("1764:l00000391", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000378", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000384", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002cd", condition()) - ) - ) - Block("1788:l000002cd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1888:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1888:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000577", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001f7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000062e", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l0000020d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003e1", condition()) - ) - ) - Block("1604:l0000020d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003e1", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003c3", condition()) - ) - ) - Block("1640:l000003c3", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003d6", condition()) - ) - ) - Block("1660:l00000252", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003d6", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003a5", condition()) - ) - ) - Block("1700:l000003a5", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003b8", condition()) - ) - ) - Block("1720:l0000028e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003b8", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_security_write/gcc_O2/basic_lock_security_write-before-analysis.il.expected b/src/test/correct/basic_lock_security_write/gcc_O2/basic_lock_security_write-before-analysis.il.expected deleted file mode 100644 index 3528f83ed..000000000 --- a/src/test/correct/basic_lock_security_write/gcc_O2/basic_lock_security_write-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000321", condition()) - ) - ) - Block("1816:l00000321", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000032f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000348", condition()) - ) - ) - Block("1828:l00000348", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000032f", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000033b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f8", condition()) - ) - ) - Block("1852:l000002f8", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l0000052b", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000222", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005df", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000238", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000398", condition()) - ) - ) - Block("1668:l00000238", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000398", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000027d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000037a", condition()) - ) - ) - Block("1704:l0000037a", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l0000027d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l0000038d", condition()) - ) - ) - Block("1724:l0000027d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l0000038d", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R2, bv64), 4bv64)] := 0bv32)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002b9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000035c", condition()) - ) - ) - Block("1764:l0000035c", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002b9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000036f", condition()) - ) - ) - Block("1784:l000002b9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000036f", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_security_write/gcc_no_plt_no_pic/basic_lock_security_write-before-analysis.il.expected b/src/test/correct/basic_lock_security_write/gcc_no_plt_no_pic/basic_lock_security_write-before-analysis.il.expected deleted file mode 100644 index 10549f694..000000000 --- a/src/test/correct/basic_lock_security_write/gcc_no_plt_no_pic/basic_lock_security_write-before-analysis.il.expected +++ /dev/null @@ -1,319 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008f0", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000098d", condition()) - ) - ) - Block("1752:l0000098d", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l0000099b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009b4", condition()) - ) - ) - Block("1764:l000009b4", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000099b", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009a7", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008f0", condition()) - ) - ) - Block("1788:l000008f0", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1888:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1888:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b9a", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000081a", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c2f", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000830", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a04", condition()) - ) - ) - Block("1604:l00000830", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a04", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009e6", condition()) - ) - ) - Block("1640:l000009e6", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009f9", condition()) - ) - ) - Block("1660:l00000875", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009f9", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008b1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009c8", condition()) - ) - ) - Block("1700:l000009c8", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000008b1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009db", condition()) - ) - ) - Block("1720:l000008b1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009db", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_security_write/gcc_pic/basic_lock_security_write-before-analysis.il.expected b/src/test/correct/basic_lock_security_write/gcc_pic/basic_lock_security_write-before-analysis.il.expected deleted file mode 100644 index 419de1839..000000000 --- a/src/test/correct/basic_lock_security_write/gcc_pic/basic_lock_security_write-before-analysis.il.expected +++ /dev/null @@ -1,319 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002cd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000036e", condition()) - ) - ) - Block("1816:l0000036e", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1840:l0000037c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000395", condition()) - ) - ) - Block("1828:l00000395", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000037c", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000388", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002cd", condition()) - ) - ) - Block("1852:l000002cd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1952:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1952:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l0000051c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001f7", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l000005ba", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l0000020d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003e5", condition()) - ) - ) - Block("1668:l0000020d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003e5", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003c7", condition()) - ) - ) - Block("1704:l000003c7", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) - ), - jumps( - GoTo("1724:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003da", condition()) - ) - ) - Block("1724:l00000252", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003da", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003a9", condition()) - ) - ) - Block("1764:l000003a9", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003bc", condition()) - ) - ) - Block("1784:l0000028e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003bc", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_unlock/clang/basic_lock_unlock-before-analysis.il.expected b/src/test/correct/basic_lock_unlock/clang/basic_lock_unlock-before-analysis.il.expected deleted file mode 100644 index 065ae552d..000000000 --- a/src/test/correct/basic_lock_unlock/clang/basic_lock_unlock-before-analysis.il.expected +++ /dev/null @@ -1,307 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002ee", condition()) - ) - ) - Block("1752:l000002ee", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002fc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000315", condition()) - ) - ) - Block("1764:l00000315", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002fc", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000308", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000029d", condition()) - ) - ) - Block("1788:l0000029d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1840:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004ef", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000059a", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000365", condition()) - ) - ) - Block("1604:l000001dd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000365", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000347", condition()) - ) - ) - Block("1640:l00000347", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000035a", condition()) - ) - ) - Block("1660:l00000222", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000035a", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000329", condition()) - ) - ) - Block("1700:l00000329", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000033c", condition()) - ) - ) - Block("1720:l0000025e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000033c", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_unlock/clang_O2/basic_lock_unlock-before-analysis.il.expected b/src/test/correct/basic_lock_unlock/clang_O2/basic_lock_unlock-before-analysis.il.expected deleted file mode 100644 index aead6bdad..000000000 --- a/src/test/correct/basic_lock_unlock/clang_O2/basic_lock_unlock-before-analysis.il.expected +++ /dev/null @@ -1,307 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002ee", condition()) - ) - ) - Block("1752:l000002ee", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002fc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000315", condition()) - ) - ) - Block("1764:l00000315", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002fc", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000308", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000029d", condition()) - ) - ) - Block("1788:l0000029d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1840:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004ef", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000059a", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000365", condition()) - ) - ) - Block("1604:l000001dd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000365", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000347", condition()) - ) - ) - Block("1640:l00000347", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000035a", condition()) - ) - ) - Block("1660:l00000222", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000035a", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 1bv64) - LocalAssign(Register(R10, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R10, bv64), 56bv64)] := 0bv32)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000329", condition()) - ) - ) - Block("1700:l00000329", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000033c", condition()) - ) - ) - Block("1720:l0000025e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000033c", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_unlock/clang_no_plt_no_pic/basic_lock_unlock-before-analysis.il.expected b/src/test/correct/basic_lock_unlock/clang_no_plt_no_pic/basic_lock_unlock-before-analysis.il.expected deleted file mode 100644 index b22421bab..000000000 --- a/src/test/correct/basic_lock_unlock/clang_no_plt_no_pic/basic_lock_unlock-before-analysis.il.expected +++ /dev/null @@ -1,307 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000082c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000087d", condition()) - ) - ) - Block("1752:l0000087d", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000088b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000008a4", condition()) - ) - ) - Block("1764:l000008a4", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000088b", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000897", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000082c", condition()) - ) - ) - Block("1788:l0000082c", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1840:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000a7e", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000756", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000b07", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000076c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000008f4", condition()) - ) - ) - Block("1604:l0000076c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000008f4", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000007b1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000008d6", condition()) - ) - ) - Block("1640:l000008d6", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l000007b1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000008e9", condition()) - ) - ) - Block("1660:l000007b1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000008e9", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000007ed", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000008b8", condition()) - ) - ) - Block("1700:l000008b8", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000007ed", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000008cb", condition()) - ) - ) - Block("1720:l000007ed", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000008cb", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_unlock/clang_pic/basic_lock_unlock-before-analysis.il.expected b/src/test/correct/basic_lock_unlock/clang_pic/basic_lock_unlock-before-analysis.il.expected deleted file mode 100644 index ea2c50526..000000000 --- a/src/test/correct/basic_lock_unlock/clang_pic/basic_lock_unlock-before-analysis.il.expected +++ /dev/null @@ -1,309 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000304", condition()) - ) - ) - Block("1816:l00000304", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) - ), - jumps( - GoTo("1840:l00000312", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000032b", condition()) - ) - ) - Block("1828:l0000032b", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000312", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000031e", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002a5", condition()) - ) - ) - Block("1852:l000002a5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1912:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1912:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l000004b2", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001cf", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l00000546", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000037b", condition()) - ) - ) - Block("1668:l000001e5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000037b", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000035d", condition()) - ) - ) - Block("1704:l0000035d", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) - ), - jumps( - GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000370", condition()) - ) - ) - Block("1724:l0000022a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000370", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4040bv64)])) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := 0bv32)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000033f", condition()) - ) - ) - Block("1764:l0000033f", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000352", condition()) - ) - ) - Block("1784:l00000266", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000352", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_unlock/gcc/basic_lock_unlock-before-analysis.il.expected b/src/test/correct/basic_lock_unlock/gcc/basic_lock_unlock-before-analysis.il.expected deleted file mode 100644 index ba7f92e56..000000000 --- a/src/test/correct/basic_lock_unlock/gcc/basic_lock_unlock-before-analysis.il.expected +++ /dev/null @@ -1,309 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000302", condition()) - ) - ) - Block("1752:l00000302", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000310", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000329", condition()) - ) - ) - Block("1764:l00000329", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000310", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000031c", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002a5", condition()) - ) - ) - Block("1788:l000002a5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1848:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000505", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001cf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005b2", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000379", condition()) - ) - ) - Block("1604:l000001e5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000379", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000035b", condition()) - ) - ) - Block("1640:l0000035b", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000036e", condition()) - ) - ) - Block("1660:l0000022a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000036e", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000033d", condition()) - ) - ) - Block("1700:l0000033d", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000350", condition()) - ) - ) - Block("1720:l00000266", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000350", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_unlock/gcc_O2/basic_lock_unlock-before-analysis.il.expected b/src/test/correct/basic_lock_unlock/gcc_O2/basic_lock_unlock-before-analysis.il.expected deleted file mode 100644 index 972b56b5e..000000000 --- a/src/test/correct/basic_lock_unlock/gcc_O2/basic_lock_unlock-before-analysis.il.expected +++ /dev/null @@ -1,307 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002fc", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000325", condition()) - ) - ) - Block("1816:l00000325", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l00000333", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000034c", condition()) - ) - ) - Block("1828:l0000034c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000333", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000033f", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002fc", condition()) - ) - ) - Block("1852:l000002fc", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l0000052f", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000226", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005e3", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l0000023c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000039c", condition()) - ) - ) - Block("1668:l0000023c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000039c", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000281", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000037e", condition()) - ) - ) - Block("1704:l0000037e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000281", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000391", condition()) - ) - ) - Block("1724:l00000281", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000391", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) - LocalAssign(Register(R3, bv64) := 1bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R3, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R2, bv64), 4bv64)] := 0bv32)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000360", condition()) - ) - ) - Block("1764:l00000360", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000373", condition()) - ) - ) - Block("1784:l000002bd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000373", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_unlock/gcc_no_plt_no_pic/basic_lock_unlock-before-analysis.il.expected b/src/test/correct/basic_lock_unlock/gcc_no_plt_no_pic/basic_lock_unlock-before-analysis.il.expected deleted file mode 100644 index e14ed6380..000000000 --- a/src/test/correct/basic_lock_unlock/gcc_no_plt_no_pic/basic_lock_unlock-before-analysis.il.expected +++ /dev/null @@ -1,309 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000084c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000008a9", condition()) - ) - ) - Block("1752:l000008a9", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000008b7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000008d0", condition()) - ) - ) - Block("1764:l000008d0", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000008b7", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000008c3", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000084c", condition()) - ) - ) - Block("1788:l0000084c", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1848:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000aac", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000776", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000b37", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l0000078c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000920", condition()) - ) - ) - Block("1604:l0000078c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000920", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000007d1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000902", condition()) - ) - ) - Block("1640:l00000902", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l000007d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000915", condition()) - ) - ) - Block("1660:l000007d1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000915", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000080d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000008e4", condition()) - ) - ) - Block("1700:l000008e4", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000080d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000008f7", condition()) - ) - ) - Block("1720:l0000080d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000008f7", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_lock_unlock/gcc_pic/basic_lock_unlock-before-analysis.il.expected b/src/test/correct/basic_lock_unlock/gcc_pic/basic_lock_unlock-before-analysis.il.expected deleted file mode 100644 index 1964c6d9f..000000000 --- a/src/test/correct/basic_lock_unlock/gcc_pic/basic_lock_unlock-before-analysis.il.expected +++ /dev/null @@ -1,309 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000304", condition()) - ) - ) - Block("1816:l00000304", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1840:l00000312", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000032b", condition()) - ) - ) - Block("1828:l0000032b", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000312", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000031e", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002a5", condition()) - ) - ) - Block("1852:l000002a5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1912:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1912:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l000004b2", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001cf", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l00000546", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000037b", condition()) - ) - ) - Block("1668:l000001e5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000037b", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000035d", condition()) - ) - ) - Block("1704:l0000035d", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) - ), - jumps( - GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000370", condition()) - ) - ) - Block("1724:l0000022a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000370", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000033f", condition()) - ) - ) - Block("1764:l0000033f", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000352", condition()) - ) - ) - Block("1784:l00000266", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000352", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_loop_assign/clang/basic_loop_assign-before-analysis.il.expected b/src/test/correct/basic_loop_assign/clang/basic_loop_assign-before-analysis.il.expected deleted file mode 100644 index 1be12d1e2..000000000 --- a/src/test/correct/basic_loop_assign/clang/basic_loop_assign-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002da", condition()) - ) - ) - Block("1752:l000002da", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000301", condition()) - ) - ) - Block("1764:l00000301", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002e8", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002f4", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000295", condition()) - ) - ) - Block("1788:l00000295", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1832:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004d9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001bf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000582", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000351", condition()) - ) - ) - Block("1604:l000001d5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000351", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000333", condition()) - ) - ) - Block("1640:l00000333", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000346", condition()) - ) - ) - Block("1660:l0000021a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000346", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 20bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000315", condition()) - ) - ) - Block("1700:l00000315", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000328", condition()) - ) - ) - Block("1720:l00000256", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000328", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_loop_assign/clang_O2/basic_loop_assign-before-analysis.il.expected b/src/test/correct/basic_loop_assign/clang_O2/basic_loop_assign-before-analysis.il.expected deleted file mode 100644 index c64bab336..000000000 --- a/src/test/correct/basic_loop_assign/clang_O2/basic_loop_assign-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002da", condition()) - ) - ) - Block("1752:l000002da", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000301", condition()) - ) - ) - Block("1764:l00000301", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002e8", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002f4", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000295", condition()) - ) - ) - Block("1788:l00000295", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1832:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004d9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001bf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000582", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000351", condition()) - ) - ) - Block("1604:l000001d5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000351", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000333", condition()) - ) - ) - Block("1640:l00000333", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000346", condition()) - ) - ) - Block("1660:l0000021a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000346", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 20bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000315", condition()) - ) - ) - Block("1700:l00000315", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000328", condition()) - ) - ) - Block("1720:l00000256", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000328", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_loop_assign/clang_no_plt_no_pic/basic_loop_assign-before-analysis.il.expected b/src/test/correct/basic_loop_assign/clang_no_plt_no_pic/basic_loop_assign-before-analysis.il.expected deleted file mode 100644 index fe9a0e038..000000000 --- a/src/test/correct/basic_loop_assign/clang_no_plt_no_pic/basic_loop_assign-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000080c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000851", condition()) - ) - ) - Block("1752:l00000851", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000085f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000878", condition()) - ) - ) - Block("1764:l00000878", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000085f", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000086b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000080c", condition()) - ) - ) - Block("1788:l0000080c", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1832:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000a50", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000736", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000ad7", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000074c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000008c8", condition()) - ) - ) - Block("1604:l0000074c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000008c8", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000008aa", condition()) - ) - ) - Block("1640:l000008aa", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000008bd", condition()) - ) - ) - Block("1660:l00000791", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000008bd", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 20bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000088c", condition()) - ) - ) - Block("1700:l0000088c", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000089f", condition()) - ) - ) - Block("1720:l000007cd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000089f", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_loop_assign/clang_pic/basic_loop_assign-before-analysis.il.expected b/src/test/correct/basic_loop_assign/clang_pic/basic_loop_assign-before-analysis.il.expected deleted file mode 100644 index 4bf470b44..000000000 --- a/src/test/correct/basic_loop_assign/clang_pic/basic_loop_assign-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000002e5", condition()) - ) - ) - Block("1816:l000002e5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) - ), - jumps( - GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000030c", condition()) - ) - ) - Block("1828:l0000030c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l000002f3", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000002ff", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l00000299", condition()) - ) - ) - Block("1852:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1900:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l00000493", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l0000053d", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000035c", condition()) - ) - ) - Block("1668:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000035c", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000033e", condition()) - ) - ) - Block("1704:l0000033e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000351", condition()) - ) - ) - Block("1724:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000351", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4040bv64)])) - LocalAssign(Register(R8, bv64) := 20bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000320", condition()) - ) - ) - Block("1764:l00000320", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000333", condition()) - ) - ) - Block("1784:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000333", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_loop_assign/gcc/basic_loop_assign-before-analysis.il.expected b/src/test/correct/basic_loop_assign/gcc/basic_loop_assign-before-analysis.il.expected deleted file mode 100644 index c7325f8c4..000000000 --- a/src/test/correct/basic_loop_assign/gcc/basic_loop_assign-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002e4", condition()) - ) - ) - Block("1752:l000002e4", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000002f2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000030b", condition()) - ) - ) - Block("1764:l0000030b", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002f2", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002fe", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000299", condition()) - ) - ) - Block("1788:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004e4", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000058e", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000035b", condition()) - ) - ) - Block("1604:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000035b", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000033d", condition()) - ) - ) - Block("1640:l0000033d", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000350", condition()) - ) - ) - Block("1660:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000350", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := 20bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000031f", condition()) - ) - ) - Block("1700:l0000031f", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000332", condition()) - ) - ) - Block("1720:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000332", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_loop_assign/gcc_O2/basic_loop_assign-before-analysis.il.expected b/src/test/correct/basic_loop_assign/gcc_O2/basic_loop_assign-before-analysis.il.expected deleted file mode 100644 index 877fefbbf..000000000 --- a/src/test/correct/basic_loop_assign/gcc_O2/basic_loop_assign-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f3", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000031c", condition()) - ) - ) - Block("1816:l0000031c", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000032a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000343", condition()) - ) - ) - Block("1828:l00000343", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000032a", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000336", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f3", condition()) - ) - ) - Block("1852:l000002f3", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l00000526", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l0000021d", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005da", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000233", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000393", condition()) - ) - ) - Block("1668:l00000233", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000393", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000375", condition()) - ) - ) - Block("1704:l00000375", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000388", condition()) - ) - ) - Block("1724:l00000278", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000388", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R2, bv64) := 20bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R2, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000357", condition()) - ) - ) - Block("1764:l00000357", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000036a", condition()) - ) - ) - Block("1784:l000002b4", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000036a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_loop_assign/gcc_no_plt_no_pic/basic_loop_assign-before-analysis.il.expected b/src/test/correct/basic_loop_assign/gcc_no_plt_no_pic/basic_loop_assign-before-analysis.il.expected deleted file mode 100644 index ba0c3bf8c..000000000 --- a/src/test/correct/basic_loop_assign/gcc_no_plt_no_pic/basic_loop_assign-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000081c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000867", condition()) - ) - ) - Block("1752:l00000867", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000088e", condition()) - ) - ) - Block("1764:l0000088e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000875", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000881", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000081c", condition()) - ) - ) - Block("1788:l0000081c", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000a67", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000746", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000aef", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l0000075c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000008de", condition()) - ) - ) - Block("1604:l0000075c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000008de", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000008c0", condition()) - ) - ) - Block("1640:l000008c0", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000008d3", condition()) - ) - ) - Block("1660:l000007a1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000008d3", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := 20bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000008a2", condition()) - ) - ) - Block("1700:l000008a2", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000008b5", condition()) - ) - ) - Block("1720:l000007dd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000008b5", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_loop_assign/gcc_pic/basic_loop_assign-before-analysis.il.expected b/src/test/correct/basic_loop_assign/gcc_pic/basic_loop_assign-before-analysis.il.expected deleted file mode 100644 index 2ca11f727..000000000 --- a/src/test/correct/basic_loop_assign/gcc_pic/basic_loop_assign-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000002e5", condition()) - ) - ) - Block("1816:l000002e5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - ), - jumps( - GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000030c", condition()) - ) - ) - Block("1828:l0000030c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l000002f3", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000002ff", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l00000299", condition()) - ) - ) - Block("1852:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1900:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l00000493", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l0000053d", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000035c", condition()) - ) - ) - Block("1668:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000035c", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000033e", condition()) - ) - ) - Block("1704:l0000033e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000351", condition()) - ) - ) - Block("1724:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000351", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R1, bv64) := 20bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000320", condition()) - ) - ) - Block("1764:l00000320", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000333", condition()) - ) - ) - Block("1784:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000333", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_operation_evaluation/clang/basic_operation_evaluation-before-analysis.il.expected b/src/test/correct/basic_operation_evaluation/clang/basic_operation_evaluation-before-analysis.il.expected deleted file mode 100644 index f3278a9be..000000000 --- a/src/test/correct/basic_operation_evaluation/clang/basic_operation_evaluation-before-analysis.il.expected +++ /dev/null @@ -1,359 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002f9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000414", condition()) - ) - ) - Block("1752:l00000414", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000422", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000043b", condition()) - ) - ) - Block("1764:l0000043b", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000422", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000042e", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002f9", condition()) - ) - ) - Block("1788:l000002f9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1932:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1932:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l0000062c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000223", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000006cc", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000239", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000048b", condition()) - ) - ) - Block("1604:l00000239", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000048b", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000046d", condition()) - ) - ) - Block("1640:l0000046d", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000480", condition()) - ) - ) - Block("1660:l0000027e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000480", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - LocalAssign(Register(R8, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) - LocalAssign(Register(R8, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("xor", Extract(Register(R8, bv64)[32:0]), Extract(Register(R9, bv64)[32:0])), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("or", Extract(Register(R8, bv64)[32:0]), Extract(Register(R9, bv64)[32:0])), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 30bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 17bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - ), - jumps( - GoTo("?:l000003c9", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R10, bv64)[32:0]), 0bv32), 0bv1))) - GoTo("?:l000003ce", condition()) - ) - ) - Block("?:l000003ce", - statements( - LocalAssign(Register(R9, bv64) := ZeroExtend(Extract(BinaryExpr("sdiv", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), SignExtend(Extract(Register(R10, bv64)[32:0]), 1))[32:0]), 32)) - ), - jumps( - GoTo("?:l000003d1", condition()) - ) - ) - Block("?:l000003c9", - statements( - LocalAssign(Register(R9, bv64) := 0bv64) - ), - jumps( - GoTo("?:l000003d1", condition()) - ) - ) - Block("?:l000003d1", - statements( - LocalAssign(Register(R9, bv64) := ZeroExtend(Extract(BinaryExpr("mul", ZeroExtend(Extract(Register(R9, bv64)[32:0]), 32), ZeroExtend(Extract(Register(R10, bv64)[32:0]), 32))[32:0]), 32)) - LocalAssign(LocalVar(#4, bv32) := UnaryExpr("not", Extract(Register(R9, bv64)[32:0]))) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), UnaryExpr("not", Extract(Register(R9, bv64)[32:0])))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), SignExtend(LocalVar(#4, bv32), 1)), 1bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), ZeroExtend(LocalVar(#4, bv32), 1)), 1bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000044f", condition()) - ) - ) - Block("1700:l0000044f", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000462", condition()) - ) - ) - Block("1720:l000002ba", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000462", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_operation_evaluation/clang_O2/basic_operation_evaluation-before-analysis.il.expected b/src/test/correct/basic_operation_evaluation/clang_O2/basic_operation_evaluation-before-analysis.il.expected deleted file mode 100644 index 3a5234909..000000000 --- a/src/test/correct/basic_operation_evaluation/clang_O2/basic_operation_evaluation-before-analysis.il.expected +++ /dev/null @@ -1,302 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000289", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002bc", condition()) - ) - ) - Block("1752:l000002bc", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000002e3", condition()) - ) - ) - Block("1764:l000002e3", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002ca", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002d6", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000289", condition()) - ) - ) - Block("1788:l00000289", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1820:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1820:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004b8", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001b3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000053c", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001c9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000333", condition()) - ) - ) - Block("1604:l000001c9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000333", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000020e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000315", condition()) - ) - ) - Block("1640:l00000315", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000020e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000328", condition()) - ) - ) - Block("1660:l0000020e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000328", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000002f7", condition()) - ) - ) - Block("1700:l000002f7", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000030a", condition()) - ) - ) - Block("1720:l0000024a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000030a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_operation_evaluation/clang_no_plt_no_pic/basic_operation_evaluation-before-analysis.il.expected b/src/test/correct/basic_operation_evaluation/clang_no_plt_no_pic/basic_operation_evaluation-before-analysis.il.expected deleted file mode 100644 index 2c1c654a3..000000000 --- a/src/test/correct/basic_operation_evaluation/clang_no_plt_no_pic/basic_operation_evaluation-before-analysis.il.expected +++ /dev/null @@ -1,359 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000009dc", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000af7", condition()) - ) - ) - Block("1752:l00000af7", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000b05", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000b1e", condition()) - ) - ) - Block("1764:l00000b1e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000b05", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000b11", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000009dc", condition()) - ) - ) - Block("1788:l000009dc", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1932:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1932:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000d0f", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000906", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000daf", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000091c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000b6e", condition()) - ) - ) - Block("1604:l0000091c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000b6e", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000961", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000b50", condition()) - ) - ) - Block("1640:l00000b50", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000961", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000b63", condition()) - ) - ) - Block("1660:l00000961", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000b63", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - LocalAssign(Register(R8, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) - LocalAssign(Register(R8, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("xor", Extract(Register(R8, bv64)[32:0]), Extract(Register(R9, bv64)[32:0])), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("or", Extract(Register(R8, bv64)[32:0]), Extract(Register(R9, bv64)[32:0])), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 30bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 17bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - ), - jumps( - GoTo("?:l00000aac", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R10, bv64)[32:0]), 0bv32), 0bv1))) - GoTo("?:l00000ab1", condition()) - ) - ) - Block("?:l00000ab1", - statements( - LocalAssign(Register(R9, bv64) := ZeroExtend(Extract(BinaryExpr("sdiv", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), SignExtend(Extract(Register(R10, bv64)[32:0]), 1))[32:0]), 32)) - ), - jumps( - GoTo("?:l00000ab4", condition()) - ) - ) - Block("?:l00000aac", - statements( - LocalAssign(Register(R9, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000ab4", condition()) - ) - ) - Block("?:l00000ab4", - statements( - LocalAssign(Register(R9, bv64) := ZeroExtend(Extract(BinaryExpr("mul", ZeroExtend(Extract(Register(R9, bv64)[32:0]), 32), ZeroExtend(Extract(Register(R10, bv64)[32:0]), 32))[32:0]), 32)) - LocalAssign(LocalVar(#4, bv32) := UnaryExpr("not", Extract(Register(R9, bv64)[32:0]))) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), UnaryExpr("not", Extract(Register(R9, bv64)[32:0])))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), SignExtend(LocalVar(#4, bv32), 1)), 1bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), ZeroExtend(LocalVar(#4, bv32), 1)), 1bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000099d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000b32", condition()) - ) - ) - Block("1700:l00000b32", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000099d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000b45", condition()) - ) - ) - Block("1720:l0000099d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000b45", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_operation_evaluation/clang_pic/basic_operation_evaluation-before-analysis.il.expected b/src/test/correct/basic_operation_evaluation/clang_pic/basic_operation_evaluation-before-analysis.il.expected deleted file mode 100644 index 2c1c654a3..000000000 --- a/src/test/correct/basic_operation_evaluation/clang_pic/basic_operation_evaluation-before-analysis.il.expected +++ /dev/null @@ -1,359 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000009dc", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000af7", condition()) - ) - ) - Block("1752:l00000af7", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000b05", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000b1e", condition()) - ) - ) - Block("1764:l00000b1e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000b05", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000b11", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000009dc", condition()) - ) - ) - Block("1788:l000009dc", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1932:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1932:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000d0f", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000906", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000daf", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000091c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000b6e", condition()) - ) - ) - Block("1604:l0000091c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000b6e", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000961", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000b50", condition()) - ) - ) - Block("1640:l00000b50", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000961", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000b63", condition()) - ) - ) - Block("1660:l00000961", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000b63", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - LocalAssign(Register(R8, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) - LocalAssign(Register(R8, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("xor", Extract(Register(R8, bv64)[32:0]), Extract(Register(R9, bv64)[32:0])), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("or", Extract(Register(R8, bv64)[32:0]), Extract(Register(R9, bv64)[32:0])), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 30bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 17bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - ), - jumps( - GoTo("?:l00000aac", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R10, bv64)[32:0]), 0bv32), 0bv1))) - GoTo("?:l00000ab1", condition()) - ) - ) - Block("?:l00000ab1", - statements( - LocalAssign(Register(R9, bv64) := ZeroExtend(Extract(BinaryExpr("sdiv", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), SignExtend(Extract(Register(R10, bv64)[32:0]), 1))[32:0]), 32)) - ), - jumps( - GoTo("?:l00000ab4", condition()) - ) - ) - Block("?:l00000aac", - statements( - LocalAssign(Register(R9, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000ab4", condition()) - ) - ) - Block("?:l00000ab4", - statements( - LocalAssign(Register(R9, bv64) := ZeroExtend(Extract(BinaryExpr("mul", ZeroExtend(Extract(Register(R9, bv64)[32:0]), 32), ZeroExtend(Extract(Register(R10, bv64)[32:0]), 32))[32:0]), 32)) - LocalAssign(LocalVar(#4, bv32) := UnaryExpr("not", Extract(Register(R9, bv64)[32:0]))) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), UnaryExpr("not", Extract(Register(R9, bv64)[32:0])))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), SignExtend(LocalVar(#4, bv32), 1)), 1bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), ZeroExtend(LocalVar(#4, bv32), 1)), 1bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000099d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000b32", condition()) - ) - ) - Block("1700:l00000b32", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000099d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000b45", condition()) - ) - ) - Block("1720:l0000099d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000b45", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_operation_evaluation/gcc/basic_operation_evaluation-before-analysis.il.expected b/src/test/correct/basic_operation_evaluation/gcc/basic_operation_evaluation-before-analysis.il.expected deleted file mode 100644 index 5fa552e4d..000000000 --- a/src/test/correct/basic_operation_evaluation/gcc/basic_operation_evaluation-before-analysis.il.expected +++ /dev/null @@ -1,352 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002f5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000003ee", condition()) - ) - ) - Block("1752:l000003ee", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000003fc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000415", condition()) - ) - ) - Block("1764:l00000415", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000003fc", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000408", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002f5", condition()) - ) - ) - Block("1788:l000002f5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1928:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1928:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000605", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000021f", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000006a4", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000235", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000465", condition()) - ) - ) - Block("1604:l00000235", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000465", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000447", condition()) - ) - ) - Block("1640:l00000447", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000045a", condition()) - ) - ) - Block("1660:l0000027a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000045a", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R1, bv64))) - LocalAssign(Register(R0, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("xor", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("or", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 30bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 17bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) - ), - jumps( - GoTo("?:l000003b3", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R1, bv64)[32:0]), 0bv32), 0bv1))) - GoTo("?:l000003b8", condition()) - ) - ) - Block("?:l000003b8", - statements( - LocalAssign(Register(R2, bv64) := ZeroExtend(Extract(BinaryExpr("sdiv", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), SignExtend(Extract(Register(R1, bv64)[32:0]), 1))[32:0]), 32)) - ), - jumps( - GoTo("?:l000003bb", condition()) - ) - ) - Block("?:l000003b3", - statements( - LocalAssign(Register(R2, bv64) := 0bv64) - ), - jumps( - GoTo("?:l000003bb", condition()) - ) - ) - Block("?:l000003bb", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(BinaryExpr("mul", ZeroExtend(Extract(Register(R2, bv64)[32:0]), 32), ZeroExtend(Extract(Register(R1, bv64)[32:0]), 32))[32:0]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), UnaryExpr("not", Extract(Register(R1, bv64)[32:0]))), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000002b6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000429", condition()) - ) - ) - Block("1700:l00000429", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000002b6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000043c", condition()) - ) - ) - Block("1720:l000002b6", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000043c", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_operation_evaluation/gcc_O2/basic_operation_evaluation-before-analysis.il.expected b/src/test/correct/basic_operation_evaluation/gcc_O2/basic_operation_evaluation-before-analysis.il.expected deleted file mode 100644 index ce866657b..000000000 --- a/src/test/correct/basic_operation_evaluation/gcc_O2/basic_operation_evaluation-before-analysis.il.expected +++ /dev/null @@ -1,302 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002e7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000310", condition()) - ) - ) - Block("1816:l00000310", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000031e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000337", condition()) - ) - ) - Block("1828:l00000337", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000031e", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000032a", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002e7", condition()) - ) - ) - Block("1852:l000002e7", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l0000051a", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000211", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005ac", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000227", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000387", condition()) - ) - ) - Block("1668:l00000227", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000387", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000026c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000369", condition()) - ) - ) - Block("1704:l00000369", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l0000026c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l0000037c", condition()) - ) - ) - Block("1724:l0000026c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l0000037c", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002a8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000034b", condition()) - ) - ) - Block("1764:l0000034b", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002a8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000035e", condition()) - ) - ) - Block("1784:l000002a8", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000035e", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_operation_evaluation/gcc_no_plt_no_pic/basic_operation_evaluation-before-analysis.il.expected b/src/test/correct/basic_operation_evaluation/gcc_no_plt_no_pic/basic_operation_evaluation-before-analysis.il.expected deleted file mode 100644 index 547946740..000000000 --- a/src/test/correct/basic_operation_evaluation/gcc_no_plt_no_pic/basic_operation_evaluation-before-analysis.il.expected +++ /dev/null @@ -1,352 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000009b0", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000aa9", condition()) - ) - ) - Block("1752:l00000aa9", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000ab7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000ad0", condition()) - ) - ) - Block("1764:l00000ad0", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000ab7", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000ac3", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000009b0", condition()) - ) - ) - Block("1788:l000009b0", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1928:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1928:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000cc0", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000008da", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000d5f", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000008f0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000b20", condition()) - ) - ) - Block("1604:l000008f0", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000b20", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000935", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000b02", condition()) - ) - ) - Block("1640:l00000b02", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000935", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000b15", condition()) - ) - ) - Block("1660:l00000935", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000b15", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R1, bv64))) - LocalAssign(Register(R0, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("xor", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("or", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 30bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 17bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) - ), - jumps( - GoTo("?:l00000a6e", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R1, bv64)[32:0]), 0bv32), 0bv1))) - GoTo("?:l00000a73", condition()) - ) - ) - Block("?:l00000a73", - statements( - LocalAssign(Register(R2, bv64) := ZeroExtend(Extract(BinaryExpr("sdiv", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), SignExtend(Extract(Register(R1, bv64)[32:0]), 1))[32:0]), 32)) - ), - jumps( - GoTo("?:l00000a76", condition()) - ) - ) - Block("?:l00000a6e", - statements( - LocalAssign(Register(R2, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000a76", condition()) - ) - ) - Block("?:l00000a76", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(BinaryExpr("mul", ZeroExtend(Extract(Register(R2, bv64)[32:0]), 32), ZeroExtend(Extract(Register(R1, bv64)[32:0]), 32))[32:0]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), UnaryExpr("not", Extract(Register(R1, bv64)[32:0]))), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000971", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000ae4", condition()) - ) - ) - Block("1700:l00000ae4", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000971", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000af7", condition()) - ) - ) - Block("1720:l00000971", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000af7", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_operation_evaluation/gcc_pic/basic_operation_evaluation-before-analysis.il.expected b/src/test/correct/basic_operation_evaluation/gcc_pic/basic_operation_evaluation-before-analysis.il.expected deleted file mode 100644 index 547946740..000000000 --- a/src/test/correct/basic_operation_evaluation/gcc_pic/basic_operation_evaluation-before-analysis.il.expected +++ /dev/null @@ -1,352 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000009b0", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000aa9", condition()) - ) - ) - Block("1752:l00000aa9", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000ab7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000ad0", condition()) - ) - ) - Block("1764:l00000ad0", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000ab7", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000ac3", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000009b0", condition()) - ) - ) - Block("1788:l000009b0", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1928:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1928:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000cc0", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000008da", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000d5f", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000008f0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000b20", condition()) - ) - ) - Block("1604:l000008f0", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000b20", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000935", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000b02", condition()) - ) - ) - Block("1640:l00000b02", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000935", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000b15", condition()) - ) - ) - Block("1660:l00000935", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000b15", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R1, bv64))) - LocalAssign(Register(R0, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("xor", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("or", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 30bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 17bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) - ), - jumps( - GoTo("?:l00000a6e", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R1, bv64)[32:0]), 0bv32), 0bv1))) - GoTo("?:l00000a73", condition()) - ) - ) - Block("?:l00000a73", - statements( - LocalAssign(Register(R2, bv64) := ZeroExtend(Extract(BinaryExpr("sdiv", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), SignExtend(Extract(Register(R1, bv64)[32:0]), 1))[32:0]), 32)) - ), - jumps( - GoTo("?:l00000a76", condition()) - ) - ) - Block("?:l00000a6e", - statements( - LocalAssign(Register(R2, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000a76", condition()) - ) - ) - Block("?:l00000a76", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(BinaryExpr("mul", ZeroExtend(Extract(Register(R2, bv64)[32:0]), 32), ZeroExtend(Extract(Register(R1, bv64)[32:0]), 32))[32:0]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), UnaryExpr("not", Extract(Register(R1, bv64)[32:0]))), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000971", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000ae4", condition()) - ) - ) - Block("1700:l00000ae4", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000971", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000af7", condition()) - ) - ) - Block("1720:l00000971", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000af7", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_sec_policy_read/clang/basic_sec_policy_read-before-analysis.il.expected b/src/test/correct/basic_sec_policy_read/clang/basic_sec_policy_read-before-analysis.il.expected deleted file mode 100644 index fa16198d3..000000000 --- a/src/test/correct/basic_sec_policy_read/clang/basic_sec_policy_read-before-analysis.il.expected +++ /dev/null @@ -1,363 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002c1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000036a", condition()) - ) - ) - Block("1752:l0000036a", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000378", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000391", condition()) - ) - ) - Block("1764:l00000391", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000378", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000384", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002c1", condition()) - ) - ) - Block("1788:l000002c1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000574", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001eb", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000629", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000201", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003e1", condition()) - ) - ) - Block("1604:l00000201", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003e1", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003c3", condition()) - ) - ) - Block("1640:l000003c3", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003d6", condition()) - ) - ) - Block("1660:l00000246", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003d6", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000336", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("?:l00000339", condition()) - ) - ) - Block("?:l00000339", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l0000033c", condition()) - ) - ) - Block("?:l00000336", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l0000033c", condition()) - ) - ) - Block("?:l0000033c", - statements( - ), - jumps( - GoTo("1864:l00000344", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1852:l0000035b", condition()) - ) - ) - Block("1852:l0000035b", - statements( - ), - jumps( - GoTo("1856:l0000035c", condition()) - ) - ) - Block("1856:l0000035c", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) - ), - jumps( - GoTo("1864:l00000344", condition()) - ) - ) - Block("1864:l00000344", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003a5", condition()) - ) - ) - Block("1700:l000003a5", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003b8", condition()) - ) - ) - Block("1720:l00000282", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003b8", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_sec_policy_read/clang_O2/basic_sec_policy_read-before-analysis.il.expected b/src/test/correct/basic_sec_policy_read/clang_O2/basic_sec_policy_read-before-analysis.il.expected deleted file mode 100644 index 47b8b7841..000000000 --- a/src/test/correct/basic_sec_policy_read/clang_O2/basic_sec_policy_read-before-analysis.il.expected +++ /dev/null @@ -1,334 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000030b", condition()) - ) - ) - Block("1752:l0000030b", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000319", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000332", condition()) - ) - ) - Block("1764:l00000332", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000319", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000325", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000029d", condition()) - ) - ) - Block("1788:l0000029d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1840:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l0000050c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005b7", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000382", condition()) - ) - ) - Block("1604:l000001dd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000382", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000364", condition()) - ) - ) - Block("1640:l00000364", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000377", condition()) - ) - ) - Block("1660:l00000222", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000377", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("?:l000002fa", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l000002fd", condition()) - ) - ) - Block("?:l000002fd", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000300", condition()) - ) - ) - Block("?:l000002fa", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(Extract(Register(R9, bv64)[32:0]), 32)) - ), - jumps( - GoTo("?:l00000300", condition()) - ) - ) - Block("?:l00000300", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000346", condition()) - ) - ) - Block("1700:l00000346", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000359", condition()) - ) - ) - Block("1720:l0000025e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000359", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_sec_policy_read/clang_no_plt_no_pic/basic_sec_policy_read-before-analysis.il.expected b/src/test/correct/basic_sec_policy_read/clang_no_plt_no_pic/basic_sec_policy_read-before-analysis.il.expected deleted file mode 100644 index b042bb2b8..000000000 --- a/src/test/correct/basic_sec_policy_read/clang_no_plt_no_pic/basic_sec_policy_read-before-analysis.il.expected +++ /dev/null @@ -1,363 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008df", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000988", condition()) - ) - ) - Block("1752:l00000988", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000996", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009af", condition()) - ) - ) - Block("1764:l000009af", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000996", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009a2", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008df", condition()) - ) - ) - Block("1788:l000008df", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b92", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000809", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c24", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000081f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000009ff", condition()) - ) - ) - Block("1604:l0000081f", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000009ff", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000864", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009e1", condition()) - ) - ) - Block("1640:l000009e1", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000864", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009f4", condition()) - ) - ) - Block("1660:l00000864", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009f4", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000954", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("?:l00000957", condition()) - ) - ) - Block("?:l00000957", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l0000095a", condition()) - ) - ) - Block("?:l00000954", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l0000095a", condition()) - ) - ) - Block("?:l0000095a", - statements( - ), - jumps( - GoTo("1864:l00000962", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1852:l00000979", condition()) - ) - ) - Block("1852:l00000979", - statements( - ), - jumps( - GoTo("1856:l0000097a", condition()) - ) - ) - Block("1856:l0000097a", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) - ), - jumps( - GoTo("1864:l00000962", condition()) - ) - ) - Block("1864:l00000962", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008a0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009c3", condition()) - ) - ) - Block("1700:l000009c3", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000008a0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009d6", condition()) - ) - ) - Block("1720:l000008a0", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009d6", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_sec_policy_read/clang_pic/basic_sec_policy_read-before-analysis.il.expected b/src/test/correct/basic_sec_policy_read/clang_pic/basic_sec_policy_read-before-analysis.il.expected deleted file mode 100644 index 1727534b5..000000000 --- a/src/test/correct/basic_sec_policy_read/clang_pic/basic_sec_policy_read-before-analysis.il.expected +++ /dev/null @@ -1,365 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002c9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000380", condition()) - ) - ) - Block("1816:l00000380", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) - ), - jumps( - GoTo("1840:l0000038e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l000003a7", condition()) - ) - ) - Block("1828:l000003a7", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000038e", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000039a", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002c9", condition()) - ) - ) - Block("1852:l000002c9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1948:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1948:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l0000052e", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001f3", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l000005cc", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l00000209", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003f7", condition()) - ) - ) - Block("1668:l00000209", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003f7", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003d9", condition()) - ) - ) - Block("1704:l000003d9", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) - ), - jumps( - GoTo("1724:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003ec", condition()) - ) - ) - Block("1724:l0000024e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003ec", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4040bv64)])) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l0000034c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("?:l0000034f", condition()) - ) - ) - Block("?:l0000034f", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000352", condition()) - ) - ) - Block("?:l0000034c", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000352", condition()) - ) - ) - Block("?:l00000352", - statements( - ), - jumps( - GoTo("1936:l0000035a", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1924:l00000371", condition()) - ) - ) - Block("1924:l00000371", - statements( - ), - jumps( - GoTo("1928:l00000372", condition()) - ) - ) - Block("1928:l00000372", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) - ), - jumps( - GoTo("1936:l0000035a", condition()) - ) - ) - Block("1936:l0000035a", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003bb", condition()) - ) - ) - Block("1764:l000003bb", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003ce", condition()) - ) - ) - Block("1784:l0000028a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003ce", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_sec_policy_read/gcc/basic_sec_policy_read-before-analysis.il.expected b/src/test/correct/basic_sec_policy_read/gcc/basic_sec_policy_read-before-analysis.il.expected deleted file mode 100644 index d41a4e91a..000000000 --- a/src/test/correct/basic_sec_policy_read/gcc/basic_sec_policy_read-before-analysis.il.expected +++ /dev/null @@ -1,332 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002b9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000034c", condition()) - ) - ) - Block("1752:l0000034c", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l0000035a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000373", condition()) - ) - ) - Block("1764:l00000373", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000035a", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000366", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002b9", condition()) - ) - ) - Block("1788:l000002b9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1868:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1868:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000554", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001e3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000608", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000001f9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003c3", condition()) - ) - ) - Block("1604:l000001f9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003c3", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003a5", condition()) - ) - ) - Block("1640:l000003a5", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003b8", condition()) - ) - ) - Block("1660:l0000023e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003b8", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1856:l0000032e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1852:l00000345", condition()) - ) - ) - Block("1852:l00000345", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - ), - jumps( - GoTo("1856:l0000032e", condition()) - ) - ) - Block("1856:l0000032e", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000387", condition()) - ) - ) - Block("1700:l00000387", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000039a", condition()) - ) - ) - Block("1720:l0000027a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000039a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_sec_policy_read/gcc_O2/basic_sec_policy_read-before-analysis.il.expected b/src/test/correct/basic_sec_policy_read/gcc_O2/basic_sec_policy_read-before-analysis.il.expected deleted file mode 100644 index 25a0e3431..000000000 --- a/src/test/correct/basic_sec_policy_read/gcc_O2/basic_sec_policy_read-before-analysis.il.expected +++ /dev/null @@ -1,321 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000320", condition()) - ) - ) - Block("1816:l00000320", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000032e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000347", condition()) - ) - ) - Block("1828:l00000347", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000032e", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000033a", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f7", condition()) - ) - ) - Block("1852:l000002f7", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l00000531", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000221", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005e7", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000237", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000397", condition()) - ) - ) - Block("1668:l00000237", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000397", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000027c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000379", condition()) - ) - ) - Block("1704:l00000379", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l0000027c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l0000038c", condition()) - ) - ) - Block("1724:l0000027c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l0000038c", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 20bv64)]), 32)) - ), - jumps( - GoTo("1560:l000001c2", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R1, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1556:l0000039c", condition()) - ) - ) - Block("1556:l0000039c", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4bv64)]), 32)) - ), - jumps( - GoTo("1560:l000001c2", condition()) - ) - ) - Block("1560:l000001c2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002b8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000035b", condition()) - ) - ) - Block("1764:l0000035b", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002b8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000036e", condition()) - ) - ) - Block("1784:l000002b8", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000036e", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_sec_policy_read/gcc_no_plt_no_pic/basic_sec_policy_read-before-analysis.il.expected b/src/test/correct/basic_sec_policy_read/gcc_no_plt_no_pic/basic_sec_policy_read-before-analysis.il.expected deleted file mode 100644 index 0e5be8b71..000000000 --- a/src/test/correct/basic_sec_policy_read/gcc_no_plt_no_pic/basic_sec_policy_read-before-analysis.il.expected +++ /dev/null @@ -1,332 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008b6", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000949", condition()) - ) - ) - Block("1752:l00000949", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000957", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000970", condition()) - ) - ) - Block("1764:l00000970", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000957", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000963", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008b6", condition()) - ) - ) - Block("1788:l000008b6", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1868:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1868:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b51", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007e0", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000be1", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000007f6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000009c0", condition()) - ) - ) - Block("1604:l000007f6", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000009c0", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000083b", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009a2", condition()) - ) - ) - Block("1640:l000009a2", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000083b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009b5", condition()) - ) - ) - Block("1660:l0000083b", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009b5", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1856:l0000092b", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1852:l00000942", condition()) - ) - ) - Block("1852:l00000942", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - ), - jumps( - GoTo("1856:l0000092b", condition()) - ) - ) - Block("1856:l0000092b", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000877", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000984", condition()) - ) - ) - Block("1700:l00000984", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000877", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000997", condition()) - ) - ) - Block("1720:l00000877", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000997", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_sec_policy_read/gcc_pic/basic_sec_policy_read-before-analysis.il.expected b/src/test/correct/basic_sec_policy_read/gcc_pic/basic_sec_policy_read-before-analysis.il.expected deleted file mode 100644 index 3f606f52b..000000000 --- a/src/test/correct/basic_sec_policy_read/gcc_pic/basic_sec_policy_read-before-analysis.il.expected +++ /dev/null @@ -1,332 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002b9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000034e", condition()) - ) - ) - Block("1816:l0000034e", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1840:l0000035c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000375", condition()) - ) - ) - Block("1828:l00000375", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000035c", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000368", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002b9", condition()) - ) - ) - Block("1852:l000002b9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1932:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1932:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l000004fc", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001e3", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l00000597", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l000001f9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003c5", condition()) - ) - ) - Block("1668:l000001f9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003c5", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003a7", condition()) - ) - ) - Block("1704:l000003a7", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) - ), - jumps( - GoTo("1724:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003ba", condition()) - ) - ) - Block("1724:l0000023e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003ba", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1920:l00000330", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1916:l00000347", condition()) - ) - ) - Block("1916:l00000347", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - ), - jumps( - GoTo("1920:l00000330", condition()) - ) - ) - Block("1920:l00000330", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000389", condition()) - ) - ) - Block("1764:l00000389", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000039c", condition()) - ) - ) - Block("1784:l0000027a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000039c", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_sec_policy_write/clang/basic_sec_policy_write-before-analysis.il.expected b/src/test/correct/basic_sec_policy_write/clang/basic_sec_policy_write-before-analysis.il.expected deleted file mode 100644 index dfefc882f..000000000 --- a/src/test/correct/basic_sec_policy_write/clang/basic_sec_policy_write-before-analysis.il.expected +++ /dev/null @@ -1,314 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002b9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000033a", condition()) - ) - ) - Block("1752:l0000033a", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000348", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000361", condition()) - ) - ) - Block("1764:l00000361", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000348", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000354", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002b9", condition()) - ) - ) - Block("1788:l000002b9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1868:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1868:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000542", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001e3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005f4", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001f9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003b1", condition()) - ) - ) - Block("1604:l000001f9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003b1", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000393", condition()) - ) - ) - Block("1640:l00000393", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003a6", condition()) - ) - ) - Block("1660:l0000023e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003a6", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := Extract(Register(R10, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000375", condition()) - ) - ) - Block("1700:l00000375", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000388", condition()) - ) - ) - Block("1720:l0000027a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000388", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_sec_policy_write/clang_O2/basic_sec_policy_write-before-analysis.il.expected b/src/test/correct/basic_sec_policy_write/clang_O2/basic_sec_policy_write-before-analysis.il.expected deleted file mode 100644 index 66390f0a2..000000000 --- a/src/test/correct/basic_sec_policy_write/clang_O2/basic_sec_policy_write-before-analysis.il.expected +++ /dev/null @@ -1,307 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002ee", condition()) - ) - ) - Block("1752:l000002ee", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002fc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000315", condition()) - ) - ) - Block("1764:l00000315", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002fc", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000308", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000029d", condition()) - ) - ) - Block("1788:l0000029d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1840:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004ef", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000059a", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000365", condition()) - ) - ) - Block("1604:l000001dd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000365", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000347", condition()) - ) - ) - Block("1640:l00000347", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000035a", condition()) - ) - ) - Block("1660:l00000222", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000035a", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R10, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R10, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000329", condition()) - ) - ) - Block("1700:l00000329", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000033c", condition()) - ) - ) - Block("1720:l0000025e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000033c", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_sec_policy_write/clang_no_plt_no_pic/basic_sec_policy_write-before-analysis.il.expected b/src/test/correct/basic_sec_policy_write/clang_no_plt_no_pic/basic_sec_policy_write-before-analysis.il.expected deleted file mode 100644 index e93cddbc8..000000000 --- a/src/test/correct/basic_sec_policy_write/clang_no_plt_no_pic/basic_sec_policy_write-before-analysis.il.expected +++ /dev/null @@ -1,314 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008a2", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000923", condition()) - ) - ) - Block("1752:l00000923", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000931", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000094a", condition()) - ) - ) - Block("1764:l0000094a", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000931", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000093d", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008a2", condition()) - ) - ) - Block("1788:l000008a2", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1868:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1868:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b2b", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007cc", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000bbb", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000007e2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000099a", condition()) - ) - ) - Block("1604:l000007e2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000099a", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000827", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000097c", condition()) - ) - ) - Block("1640:l0000097c", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000827", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000098f", condition()) - ) - ) - Block("1660:l00000827", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000098f", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := Extract(Register(R10, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000863", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000095e", condition()) - ) - ) - Block("1700:l0000095e", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000863", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000971", condition()) - ) - ) - Block("1720:l00000863", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000971", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_sec_policy_write/clang_pic/basic_sec_policy_write-before-analysis.il.expected b/src/test/correct/basic_sec_policy_write/clang_pic/basic_sec_policy_write-before-analysis.il.expected deleted file mode 100644 index 1de3b2155..000000000 --- a/src/test/correct/basic_sec_policy_write/clang_pic/basic_sec_policy_write-before-analysis.il.expected +++ /dev/null @@ -1,316 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002c1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000350", condition()) - ) - ) - Block("1816:l00000350", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) - ), - jumps( - GoTo("1840:l0000035e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000377", condition()) - ) - ) - Block("1828:l00000377", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000035e", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000036a", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002c1", condition()) - ) - ) - Block("1852:l000002c1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1940:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1940:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l000004fe", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001eb", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l00000599", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l00000201", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003c7", condition()) - ) - ) - Block("1668:l00000201", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003c7", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003a9", condition()) - ) - ) - Block("1704:l000003a9", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) - ), - jumps( - GoTo("1724:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003bc", condition()) - ) - ) - Block("1724:l00000246", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003bc", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4032bv64)])) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4040bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R10, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000038b", condition()) - ) - ) - Block("1764:l0000038b", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000039e", condition()) - ) - ) - Block("1784:l00000282", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000039e", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_sec_policy_write/gcc/basic_sec_policy_write-before-analysis.il.expected b/src/test/correct/basic_sec_policy_write/gcc/basic_sec_policy_write-before-analysis.il.expected deleted file mode 100644 index 78914f863..000000000 --- a/src/test/correct/basic_sec_policy_write/gcc/basic_sec_policy_write-before-analysis.il.expected +++ /dev/null @@ -1,320 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002d1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000374", condition()) - ) - ) - Block("1752:l00000374", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000382", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000039b", condition()) - ) - ) - Block("1764:l0000039b", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000382", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000038e", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002d1", condition()) - ) - ) - Block("1788:l000002d1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1892:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1892:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000582", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001fb", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000063a", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000211", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003eb", condition()) - ) - ) - Block("1604:l00000211", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003eb", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003cd", condition()) - ) - ) - Block("1640:l000003cd", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003e0", condition()) - ) - ) - Block("1660:l00000256", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003e0", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003af", condition()) - ) - ) - Block("1700:l000003af", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003c2", condition()) - ) - ) - Block("1720:l00000292", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003c2", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_sec_policy_write/gcc_O2/basic_sec_policy_write-before-analysis.il.expected b/src/test/correct/basic_sec_policy_write/gcc_O2/basic_sec_policy_write-before-analysis.il.expected deleted file mode 100644 index ababc3d28..000000000 --- a/src/test/correct/basic_sec_policy_write/gcc_O2/basic_sec_policy_write-before-analysis.il.expected +++ /dev/null @@ -1,307 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002fc", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000325", condition()) - ) - ) - Block("1816:l00000325", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l00000333", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000034c", condition()) - ) - ) - Block("1828:l0000034c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000333", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000033f", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002fc", condition()) - ) - ) - Block("1852:l000002fc", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l0000052f", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000226", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005e3", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l0000023c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000039c", condition()) - ) - ) - Block("1668:l0000023c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000039c", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000281", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000037e", condition()) - ) - ) - Block("1704:l0000037e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000281", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000391", condition()) - ) - ) - Block("1724:l00000281", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000391", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) - LocalAssign(Register(R3, bv64) := 2bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R2, bv64), 4bv64)] := Extract(Register(R3, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000360", condition()) - ) - ) - Block("1764:l00000360", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000373", condition()) - ) - ) - Block("1784:l000002bd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000373", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_sec_policy_write/gcc_no_plt_no_pic/basic_sec_policy_write-before-analysis.il.expected b/src/test/correct/basic_sec_policy_write/gcc_no_plt_no_pic/basic_sec_policy_write-before-analysis.il.expected deleted file mode 100644 index 98e296e9f..000000000 --- a/src/test/correct/basic_sec_policy_write/gcc_no_plt_no_pic/basic_sec_policy_write-before-analysis.il.expected +++ /dev/null @@ -1,320 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000900", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000009a3", condition()) - ) - ) - Block("1752:l000009a3", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000009b1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009ca", condition()) - ) - ) - Block("1764:l000009ca", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000009b1", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009bd", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000900", condition()) - ) - ) - Block("1788:l00000900", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1892:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1892:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000bb1", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000082a", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c47", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000840", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a1a", condition()) - ) - ) - Block("1604:l00000840", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a1a", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000885", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009fc", condition()) - ) - ) - Block("1640:l000009fc", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000885", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a0f", condition()) - ) - ) - Block("1660:l00000885", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a0f", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009de", condition()) - ) - ) - Block("1700:l000009de", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000008c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009f1", condition()) - ) - ) - Block("1720:l000008c1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009f1", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basic_sec_policy_write/gcc_pic/basic_sec_policy_write-before-analysis.il.expected b/src/test/correct/basic_sec_policy_write/gcc_pic/basic_sec_policy_write-before-analysis.il.expected deleted file mode 100644 index d20542a29..000000000 --- a/src/test/correct/basic_sec_policy_write/gcc_pic/basic_sec_policy_write-before-analysis.il.expected +++ /dev/null @@ -1,320 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002d1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000378", condition()) - ) - ) - Block("1816:l00000378", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1840:l00000386", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000039f", condition()) - ) - ) - Block("1828:l0000039f", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000386", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000392", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002d1", condition()) - ) - ) - Block("1852:l000002d1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1956:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1956:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l00000526", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001fb", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l000005c5", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000211", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003ef", condition()) - ) - ) - Block("1668:l00000211", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003ef", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003d1", condition()) - ) - ) - Block("1704:l000003d1", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) - ), - jumps( - GoTo("1724:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003e4", condition()) - ) - ) - Block("1724:l00000256", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003e4", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R1, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003b3", condition()) - ) - ) - Block("1764:l000003b3", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003c6", condition()) - ) - ) - Block("1784:l00000292", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003c6", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basicassign_gamma0/clang/basicassign_gamma0-before-analysis.il.expected b/src/test/correct/basicassign_gamma0/clang/basicassign_gamma0-before-analysis.il.expected deleted file mode 100644 index f70a1910e..000000000 --- a/src/test/correct/basicassign_gamma0/clang/basicassign_gamma0-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002e5", condition()) - ) - ) - Block("1752:l000002e5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000030c", condition()) - ) - ) - Block("1764:l0000030c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002f3", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002ff", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000299", condition()) - ) - ) - Block("1788:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004e5", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000058f", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000035c", condition()) - ) - ) - Block("1604:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000035c", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000033e", condition()) - ) - ) - Block("1640:l0000033e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000351", condition()) - ) - ) - Block("1660:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000351", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(Register(R9, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000320", condition()) - ) - ) - Block("1700:l00000320", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000333", condition()) - ) - ) - Block("1720:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000333", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basicassign_gamma0/clang_O2/basicassign_gamma0-before-analysis.il.expected b/src/test/correct/basicassign_gamma0/clang_O2/basicassign_gamma0-before-analysis.il.expected deleted file mode 100644 index 0813e3426..000000000 --- a/src/test/correct/basicassign_gamma0/clang_O2/basicassign_gamma0-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002e5", condition()) - ) - ) - Block("1752:l000002e5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000030c", condition()) - ) - ) - Block("1764:l0000030c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002f3", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002ff", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000299", condition()) - ) - ) - Block("1788:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004e5", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000058f", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000035c", condition()) - ) - ) - Block("1604:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000035c", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000033e", condition()) - ) - ) - Block("1640:l0000033e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000351", condition()) - ) - ) - Block("1660:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000351", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000320", condition()) - ) - ) - Block("1700:l00000320", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000333", condition()) - ) - ) - Block("1720:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000333", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basicassign_gamma0/clang_no_plt_no_pic/basicassign_gamma0-before-analysis.il.expected b/src/test/correct/basicassign_gamma0/clang_no_plt_no_pic/basicassign_gamma0-before-analysis.il.expected deleted file mode 100644 index 1ce985d86..000000000 --- a/src/test/correct/basicassign_gamma0/clang_no_plt_no_pic/basicassign_gamma0-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000081d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000869", condition()) - ) - ) - Block("1752:l00000869", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000877", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000890", condition()) - ) - ) - Block("1764:l00000890", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000877", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000883", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000081d", condition()) - ) - ) - Block("1788:l0000081d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000a69", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000747", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000af1", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000075d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000008e0", condition()) - ) - ) - Block("1604:l0000075d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000008e0", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000007a2", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000008c2", condition()) - ) - ) - Block("1640:l000008c2", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l000007a2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000008d5", condition()) - ) - ) - Block("1660:l000007a2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000008d5", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(Register(R9, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000007de", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000008a4", condition()) - ) - ) - Block("1700:l000008a4", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000007de", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000008b7", condition()) - ) - ) - Block("1720:l000007de", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000008b7", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basicassign_gamma0/clang_pic/basicassign_gamma0-before-analysis.il.expected b/src/test/correct/basicassign_gamma0/clang_pic/basicassign_gamma0-before-analysis.il.expected deleted file mode 100644 index cd2d2911e..000000000 --- a/src/test/correct/basicassign_gamma0/clang_pic/basicassign_gamma0-before-analysis.il.expected +++ /dev/null @@ -1,308 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002a1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000002fb", condition()) - ) - ) - Block("1816:l000002fb", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) - ), - jumps( - GoTo("1840:l00000309", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000322", condition()) - ) - ) - Block("1828:l00000322", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000309", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000315", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002a1", condition()) - ) - ) - Block("1852:l000002a1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1908:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1908:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l000004a9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001cb", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l0000053c", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1668:l000001e1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000372", condition()) - ) - ) - Block("1668:l000001e1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000372", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000354", condition()) - ) - ) - Block("1704:l00000354", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) - ), - jumps( - GoTo("1724:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000367", condition()) - ) - ) - Block("1724:l00000226", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000367", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4048bv64)])) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4032bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000336", condition()) - ) - ) - Block("1764:l00000336", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000349", condition()) - ) - ) - Block("1784:l00000262", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000349", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basicassign_gamma0/gcc/basicassign_gamma0-before-analysis.il.expected b/src/test/correct/basicassign_gamma0/gcc/basicassign_gamma0-before-analysis.il.expected deleted file mode 100644 index 0da535230..000000000 --- a/src/test/correct/basicassign_gamma0/gcc/basicassign_gamma0-before-analysis.il.expected +++ /dev/null @@ -1,308 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002a1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002f9", condition()) - ) - ) - Block("1752:l000002f9", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000307", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000320", condition()) - ) - ) - Block("1764:l00000320", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000307", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000313", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002a1", condition()) - ) - ) - Block("1788:l000002a1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1844:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004fb", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001cb", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005a7", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000001e1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000370", condition()) - ) - ) - Block("1604:l000001e1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000370", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000352", condition()) - ) - ) - Block("1640:l00000352", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000365", condition()) - ) - ) - Block("1660:l00000226", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000365", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000334", condition()) - ) - ) - Block("1700:l00000334", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000347", condition()) - ) - ) - Block("1720:l00000262", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000347", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basicassign_gamma0/gcc_O2/basicassign_gamma0-before-analysis.il.expected b/src/test/correct/basicassign_gamma0/gcc_O2/basicassign_gamma0-before-analysis.il.expected deleted file mode 100644 index 22ecdd1d6..000000000 --- a/src/test/correct/basicassign_gamma0/gcc_O2/basicassign_gamma0-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000322", condition()) - ) - ) - Block("1816:l00000322", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l00000330", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000349", condition()) - ) - ) - Block("1828:l00000349", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000330", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000033c", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f9", condition()) - ) - ) - Block("1852:l000002f9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l0000052c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000223", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005e0", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000239", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000399", condition()) - ) - ) - Block("1668:l00000239", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000399", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000037b", condition()) - ) - ) - Block("1704:l0000037b", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l0000038e", condition()) - ) - ) - Block("1724:l0000027e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l0000038e", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R2, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R2, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000035d", condition()) - ) - ) - Block("1764:l0000035d", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000370", condition()) - ) - ) - Block("1784:l000002ba", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000370", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basicassign_gamma0/gcc_no_plt_no_pic/basicassign_gamma0-before-analysis.il.expected b/src/test/correct/basicassign_gamma0/gcc_no_plt_no_pic/basicassign_gamma0-before-analysis.il.expected deleted file mode 100644 index 2452063c1..000000000 --- a/src/test/correct/basicassign_gamma0/gcc_no_plt_no_pic/basicassign_gamma0-before-analysis.il.expected +++ /dev/null @@ -1,308 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000083d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000895", condition()) - ) - ) - Block("1752:l00000895", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000008a3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000008bc", condition()) - ) - ) - Block("1764:l000008bc", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000008a3", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000008af", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000083d", condition()) - ) - ) - Block("1788:l0000083d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1844:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000a97", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000767", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000b21", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l0000077d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000090c", condition()) - ) - ) - Block("1604:l0000077d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000090c", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000007c2", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000008ee", condition()) - ) - ) - Block("1640:l000008ee", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l000007c2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000901", condition()) - ) - ) - Block("1660:l000007c2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000901", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000007fe", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000008d0", condition()) - ) - ) - Block("1700:l000008d0", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000007fe", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000008e3", condition()) - ) - ) - Block("1720:l000007fe", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000008e3", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basicassign_gamma0/gcc_pic/basicassign_gamma0-before-analysis.il.expected b/src/test/correct/basicassign_gamma0/gcc_pic/basicassign_gamma0-before-analysis.il.expected deleted file mode 100644 index d3b140d48..000000000 --- a/src/test/correct/basicassign_gamma0/gcc_pic/basicassign_gamma0-before-analysis.il.expected +++ /dev/null @@ -1,308 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002a1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000002fb", condition()) - ) - ) - Block("1816:l000002fb", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1840:l00000309", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000322", condition()) - ) - ) - Block("1828:l00000322", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000309", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000315", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002a1", condition()) - ) - ) - Block("1852:l000002a1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1908:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1908:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l000004a9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001cb", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l0000053c", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1668:l000001e1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000372", condition()) - ) - ) - Block("1668:l000001e1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000372", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000354", condition()) - ) - ) - Block("1704:l00000354", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) - ), - jumps( - GoTo("1724:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000367", condition()) - ) - ) - Block("1724:l00000226", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000367", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000336", condition()) - ) - ) - Block("1764:l00000336", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000349", condition()) - ) - ) - Block("1784:l00000262", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000349", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basicfree/clang/basicfree-before-analysis.il.expected b/src/test/correct/basicfree/clang/basicfree-before-analysis.il.expected deleted file mode 100644 index cd3ee19eb..000000000 --- a/src/test/correct/basicfree/clang/basicfree-before-analysis.il.expected +++ /dev/null @@ -1,336 +0,0 @@ -Procedure("1600:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 64bv64)]), 56)) - ), - jumps( - GoTo("1980:l000002b9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1944:l00000353", condition()) - ) - ) - Block("1944:l00000353", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1968:l00000361", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1956:l0000037a", condition()) - ) - ) - Block("1956:l0000037a", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 56bv64)])) - LocalAssign(Register(R30, bv64) := 1968bv64) - ), - jumps( - DirectCall("1600:__cxa_finalize", condition()) - ) - ) - Block("1968:l00000361", - statements( - LocalAssign(Register(R30, bv64) := 1972bv64) - ), - jumps( - DirectCall("1808:deregister_tm_clones", condition()) - ) - ) - Block("1972:l0000036d", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 64bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1980:l000002b9", condition()) - ) - ) - Block("1980:l000002b9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1584:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1584:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2060:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2060:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1520:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1536bv64) - ), - jumps( - DirectCall("1780:call_weak_fn", condition()) - ) - ) - Block("1536:l0000054d", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1584:__libc_start_main", condition()) - ) - ) - Block("1776:l000001e3", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1648:abort", condition()) - ) - ) - Block("?:l000005eb", - statements( - ), - jumps( - DirectCall("1780:call_weak_fn", condition()) - ) - ) -)), -Procedure("1648:abort", in(), out(), blocks( -)), -Procedure("1780:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1780:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1796:l000001f9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1792:l000003ca", condition()) - ) - ) - Block("1796:l000001f9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1792:l000003ca", - statements( - ), - jumps( - GoTo("1632:l__gmon_start__", condition()) - ) - ) - Block("1632:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1808:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 64bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 64bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1852:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1832:l000003ac", condition()) - ) - ) - Block("1832:l000003ac", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1852:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1844:l000003bf", condition()) - ) - ) - Block("1852:l0000023e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1844:l000003bf", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2000:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2000:lframe_dummy", - statements( - ), - jumps( - DirectCall("1856:register_tm_clones", condition()) - ) - ) -)), -Procedure("1664:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2004:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2004:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2024bv64) - ), - jumps( - DirectCall("1616:malloc", condition()) - ) - ) - Block("2024:l0000030d", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2048bv64) - ), - jumps( - DirectCall("1664:#free", condition()) - ) - ) - Block("2048:l00000338", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1616:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1856:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 64bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 64bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1912:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1892:l0000038e", condition()) - ) - ) - Block("1892:l0000038e", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1912:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1904:l000003a1", condition()) - ) - ) - Block("1912:l0000027a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1904:l000003a1", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basicfree/clang_O2/basicfree-before-analysis.il.expected b/src/test/correct/basicfree/clang_O2/basicfree-before-analysis.il.expected deleted file mode 100644 index af5bdc2a2..000000000 --- a/src/test/correct/basicfree/clang_O2/basicfree-before-analysis.il.expected +++ /dev/null @@ -1,301 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000285", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002b3", condition()) - ) - ) - Block("1752:l000002b3", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000002da", condition()) - ) - ) - Block("1764:l000002da", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002c1", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002cd", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000285", condition()) - ) - ) - Block("1788:l00000285", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1816:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1816:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004ae", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001af", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000553", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001c5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000032a", condition()) - ) - ) - Block("1604:l000001c5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000032a", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000020a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000030c", condition()) - ) - ) - Block("1640:l0000030c", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000020a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000031f", condition()) - ) - ) - Block("1660:l0000020a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000031f", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000002ee", condition()) - ) - ) - Block("1700:l000002ee", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000301", condition()) - ) - ) - Block("1720:l00000246", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000301", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basicfree/clang_no_plt_no_pic/basicfree-before-analysis.il.expected b/src/test/correct/basicfree/clang_no_plt_no_pic/basicfree-before-analysis.il.expected deleted file mode 100644 index 03c9de193..000000000 --- a/src/test/correct/basicfree/clang_no_plt_no_pic/basicfree-before-analysis.il.expected +++ /dev/null @@ -1,336 +0,0 @@ -Procedure("1600:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 64bv64)]), 56)) - ), - jumps( - GoTo("1980:l00000899", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1944:l00000933", condition()) - ) - ) - Block("1944:l00000933", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1968:l00000941", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1956:l0000095a", condition()) - ) - ) - Block("1956:l0000095a", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 56bv64)])) - LocalAssign(Register(R30, bv64) := 1968bv64) - ), - jumps( - DirectCall("1600:__cxa_finalize", condition()) - ) - ) - Block("1968:l00000941", - statements( - LocalAssign(Register(R30, bv64) := 1972bv64) - ), - jumps( - DirectCall("1808:deregister_tm_clones", condition()) - ) - ) - Block("1972:l0000094d", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 64bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1980:l00000899", condition()) - ) - ) - Block("1980:l00000899", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1584:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1584:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2060:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2060:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1520:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1536bv64) - ), - jumps( - DirectCall("1780:call_weak_fn", condition()) - ) - ) - Block("1536:l00000b2d", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1584:__libc_start_main", condition()) - ) - ) - Block("1776:l000007c3", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1648:abort", condition()) - ) - ) - Block("?:l00000ba4", - statements( - ), - jumps( - DirectCall("1780:call_weak_fn", condition()) - ) - ) -)), -Procedure("1648:abort", in(), out(), blocks( -)), -Procedure("1780:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1780:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1796:l000007d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1792:l000009aa", condition()) - ) - ) - Block("1796:l000007d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1792:l000009aa", - statements( - ), - jumps( - GoTo("1632:l__gmon_start__", condition()) - ) - ) - Block("1632:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1808:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 64bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 64bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1852:l0000081e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1832:l0000098c", condition()) - ) - ) - Block("1832:l0000098c", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1852:l0000081e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1844:l0000099f", condition()) - ) - ) - Block("1852:l0000081e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1844:l0000099f", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2000:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2000:lframe_dummy", - statements( - ), - jumps( - DirectCall("1856:register_tm_clones", condition()) - ) - ) -)), -Procedure("1664:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2004:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2004:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2024bv64) - ), - jumps( - DirectCall("1616:malloc", condition()) - ) - ) - Block("2024:l000008ed", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2048bv64) - ), - jumps( - DirectCall("1664:#free", condition()) - ) - ) - Block("2048:l00000918", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1616:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1856:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 64bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 64bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1912:l0000085a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1892:l0000096e", condition()) - ) - ) - Block("1892:l0000096e", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1912:l0000085a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1904:l00000981", condition()) - ) - ) - Block("1912:l0000085a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1904:l00000981", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basicfree/clang_pic/basicfree-before-analysis.il.expected b/src/test/correct/basicfree/clang_pic/basicfree-before-analysis.il.expected deleted file mode 100644 index 03c9de193..000000000 --- a/src/test/correct/basicfree/clang_pic/basicfree-before-analysis.il.expected +++ /dev/null @@ -1,336 +0,0 @@ -Procedure("1600:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 64bv64)]), 56)) - ), - jumps( - GoTo("1980:l00000899", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1944:l00000933", condition()) - ) - ) - Block("1944:l00000933", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1968:l00000941", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1956:l0000095a", condition()) - ) - ) - Block("1956:l0000095a", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 56bv64)])) - LocalAssign(Register(R30, bv64) := 1968bv64) - ), - jumps( - DirectCall("1600:__cxa_finalize", condition()) - ) - ) - Block("1968:l00000941", - statements( - LocalAssign(Register(R30, bv64) := 1972bv64) - ), - jumps( - DirectCall("1808:deregister_tm_clones", condition()) - ) - ) - Block("1972:l0000094d", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 64bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1980:l00000899", condition()) - ) - ) - Block("1980:l00000899", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1584:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1584:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2060:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2060:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1520:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1536bv64) - ), - jumps( - DirectCall("1780:call_weak_fn", condition()) - ) - ) - Block("1536:l00000b2d", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1584:__libc_start_main", condition()) - ) - ) - Block("1776:l000007c3", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1648:abort", condition()) - ) - ) - Block("?:l00000ba4", - statements( - ), - jumps( - DirectCall("1780:call_weak_fn", condition()) - ) - ) -)), -Procedure("1648:abort", in(), out(), blocks( -)), -Procedure("1780:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1780:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1796:l000007d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1792:l000009aa", condition()) - ) - ) - Block("1796:l000007d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1792:l000009aa", - statements( - ), - jumps( - GoTo("1632:l__gmon_start__", condition()) - ) - ) - Block("1632:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1808:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 64bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 64bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1852:l0000081e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1832:l0000098c", condition()) - ) - ) - Block("1832:l0000098c", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1852:l0000081e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1844:l0000099f", condition()) - ) - ) - Block("1852:l0000081e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1844:l0000099f", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2000:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2000:lframe_dummy", - statements( - ), - jumps( - DirectCall("1856:register_tm_clones", condition()) - ) - ) -)), -Procedure("1664:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2004:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2004:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2024bv64) - ), - jumps( - DirectCall("1616:malloc", condition()) - ) - ) - Block("2024:l000008ed", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2048bv64) - ), - jumps( - DirectCall("1664:#free", condition()) - ) - ) - Block("2048:l00000918", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1616:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1856:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 64bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 64bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1912:l0000085a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1892:l0000096e", condition()) - ) - ) - Block("1892:l0000096e", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1912:l0000085a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1904:l00000981", condition()) - ) - ) - Block("1912:l0000085a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1904:l00000981", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basicfree/gcc/basicfree-before-analysis.il.expected b/src/test/correct/basicfree/gcc/basicfree-before-analysis.il.expected deleted file mode 100644 index 0e6b40296..000000000 --- a/src/test/correct/basicfree/gcc/basicfree-before-analysis.il.expected +++ /dev/null @@ -1,335 +0,0 @@ -Procedure("1600:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1980:l000002b5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1944:l00000349", condition()) - ) - ) - Block("1944:l00000349", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1968:l00000357", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000370", condition()) - ) - ) - Block("1956:l00000370", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1968bv64) - ), - jumps( - DirectCall("1600:__cxa_finalize", condition()) - ) - ) - Block("1968:l00000357", - statements( - LocalAssign(Register(R30, bv64) := 1972bv64) - ), - jumps( - DirectCall("1808:deregister_tm_clones", condition()) - ) - ) - Block("1972:l00000363", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1980:l000002b5", condition()) - ) - ) - Block("1980:l000002b5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1584:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1584:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2056:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2056:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1520:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1536bv64) - ), - jumps( - DirectCall("1780:call_weak_fn", condition()) - ) - ) - Block("1536:l00000543", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1584:__libc_start_main", condition()) - ) - ) - Block("1776:l000001df", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1648:abort", condition()) - ) - ) - Block("?:l000005e0", - statements( - ), - jumps( - DirectCall("1780:call_weak_fn", condition()) - ) - ) -)), -Procedure("1648:abort", in(), out(), blocks( -)), -Procedure("1780:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1780:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1796:l000001f5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1792:l000003c0", condition()) - ) - ) - Block("1796:l000001f5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1792:l000003c0", - statements( - ), - jumps( - GoTo("1632:l__gmon_start__", condition()) - ) - ) - Block("1632:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1808:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1852:l0000023a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1832:l000003a2", condition()) - ) - ) - Block("1832:l000003a2", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1852:l0000023a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1844:l000003b5", condition()) - ) - ) - Block("1852:l0000023a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1844:l000003b5", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2000:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2000:lframe_dummy", - statements( - ), - jumps( - DirectCall("1856:register_tm_clones", condition()) - ) - ) -)), -Procedure("1664:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2004:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2004:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2020bv64) - ), - jumps( - DirectCall("1616:malloc", condition()) - ) - ) - Block("2020:l00000307", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R30, bv64) := 2044bv64) - ), - jumps( - DirectCall("1664:#free", condition()) - ) - ) - Block("2044:l00000332", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1616:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1856:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1912:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1892:l00000384", condition()) - ) - ) - Block("1892:l00000384", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1912:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1904:l00000397", condition()) - ) - ) - Block("1912:l00000276", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1904:l00000397", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basicfree/gcc_O2/basicfree-before-analysis.il.expected b/src/test/correct/basicfree/gcc_O2/basicfree-before-analysis.il.expected deleted file mode 100644 index 7387e4ace..000000000 --- a/src/test/correct/basicfree/gcc_O2/basicfree-before-analysis.il.expected +++ /dev/null @@ -1,301 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002e4", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000030d", condition()) - ) - ) - Block("1816:l0000030d", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000031b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000334", condition()) - ) - ) - Block("1828:l00000334", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000031b", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000327", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002e4", condition()) - ) - ) - Block("1852:l000002e4", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l00000517", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l0000020e", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005cb", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000224", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000384", condition()) - ) - ) - Block("1668:l00000224", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000384", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000269", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000366", condition()) - ) - ) - Block("1704:l00000366", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000269", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000379", condition()) - ) - ) - Block("1724:l00000269", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000379", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002a5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000348", condition()) - ) - ) - Block("1764:l00000348", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002a5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000035b", condition()) - ) - ) - Block("1784:l000002a5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000035b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basicfree/gcc_no_plt_no_pic/basicfree-before-analysis.il.expected b/src/test/correct/basicfree/gcc_no_plt_no_pic/basicfree-before-analysis.il.expected deleted file mode 100644 index b7ac27390..000000000 --- a/src/test/correct/basicfree/gcc_no_plt_no_pic/basicfree-before-analysis.il.expected +++ /dev/null @@ -1,335 +0,0 @@ -Procedure("1600:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1980:l0000088a", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1944:l0000091e", condition()) - ) - ) - Block("1944:l0000091e", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1968:l0000092c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000945", condition()) - ) - ) - Block("1956:l00000945", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1968bv64) - ), - jumps( - DirectCall("1600:__cxa_finalize", condition()) - ) - ) - Block("1968:l0000092c", - statements( - LocalAssign(Register(R30, bv64) := 1972bv64) - ), - jumps( - DirectCall("1808:deregister_tm_clones", condition()) - ) - ) - Block("1972:l00000938", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1980:l0000088a", condition()) - ) - ) - Block("1980:l0000088a", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1584:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1584:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2056:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2056:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1520:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1536bv64) - ), - jumps( - DirectCall("1780:call_weak_fn", condition()) - ) - ) - Block("1536:l00000b18", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1584:__libc_start_main", condition()) - ) - ) - Block("1776:l000007b4", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1648:abort", condition()) - ) - ) - Block("?:l00000b8e", - statements( - ), - jumps( - DirectCall("1780:call_weak_fn", condition()) - ) - ) -)), -Procedure("1648:abort", in(), out(), blocks( -)), -Procedure("1780:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1780:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1796:l000007ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1792:l00000995", condition()) - ) - ) - Block("1796:l000007ca", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1792:l00000995", - statements( - ), - jumps( - GoTo("1632:l__gmon_start__", condition()) - ) - ) - Block("1632:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1808:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1852:l0000080f", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1832:l00000977", condition()) - ) - ) - Block("1832:l00000977", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1852:l0000080f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1844:l0000098a", condition()) - ) - ) - Block("1852:l0000080f", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1844:l0000098a", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2000:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2000:lframe_dummy", - statements( - ), - jumps( - DirectCall("1856:register_tm_clones", condition()) - ) - ) -)), -Procedure("1664:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2004:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2004:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2020bv64) - ), - jumps( - DirectCall("1616:malloc", condition()) - ) - ) - Block("2020:l000008dc", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R30, bv64) := 2044bv64) - ), - jumps( - DirectCall("1664:#free", condition()) - ) - ) - Block("2044:l00000907", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1616:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1856:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1912:l0000084b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1892:l00000959", condition()) - ) - ) - Block("1892:l00000959", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1912:l0000084b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1904:l0000096c", condition()) - ) - ) - Block("1912:l0000084b", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1904:l0000096c", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/basicfree/gcc_pic/basicfree-before-analysis.il.expected b/src/test/correct/basicfree/gcc_pic/basicfree-before-analysis.il.expected deleted file mode 100644 index b7ac27390..000000000 --- a/src/test/correct/basicfree/gcc_pic/basicfree-before-analysis.il.expected +++ /dev/null @@ -1,335 +0,0 @@ -Procedure("1600:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1980:l0000088a", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1944:l0000091e", condition()) - ) - ) - Block("1944:l0000091e", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1968:l0000092c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000945", condition()) - ) - ) - Block("1956:l00000945", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1968bv64) - ), - jumps( - DirectCall("1600:__cxa_finalize", condition()) - ) - ) - Block("1968:l0000092c", - statements( - LocalAssign(Register(R30, bv64) := 1972bv64) - ), - jumps( - DirectCall("1808:deregister_tm_clones", condition()) - ) - ) - Block("1972:l00000938", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1980:l0000088a", condition()) - ) - ) - Block("1980:l0000088a", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1584:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1584:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2056:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2056:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1520:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1536bv64) - ), - jumps( - DirectCall("1780:call_weak_fn", condition()) - ) - ) - Block("1536:l00000b18", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1584:__libc_start_main", condition()) - ) - ) - Block("1776:l000007b4", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1648:abort", condition()) - ) - ) - Block("?:l00000b8e", - statements( - ), - jumps( - DirectCall("1780:call_weak_fn", condition()) - ) - ) -)), -Procedure("1648:abort", in(), out(), blocks( -)), -Procedure("1780:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1780:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1796:l000007ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1792:l00000995", condition()) - ) - ) - Block("1796:l000007ca", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1792:l00000995", - statements( - ), - jumps( - GoTo("1632:l__gmon_start__", condition()) - ) - ) - Block("1632:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1808:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1852:l0000080f", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1832:l00000977", condition()) - ) - ) - Block("1832:l00000977", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1852:l0000080f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1844:l0000098a", condition()) - ) - ) - Block("1852:l0000080f", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1844:l0000098a", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2000:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2000:lframe_dummy", - statements( - ), - jumps( - DirectCall("1856:register_tm_clones", condition()) - ) - ) -)), -Procedure("1664:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2004:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2004:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2020bv64) - ), - jumps( - DirectCall("1616:malloc", condition()) - ) - ) - Block("2020:l000008dc", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R30, bv64) := 2044bv64) - ), - jumps( - DirectCall("1664:#free", condition()) - ) - ) - Block("2044:l00000907", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1616:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1856:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1912:l0000084b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1892:l00000959", condition()) - ) - ) - Block("1892:l00000959", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1912:l0000084b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1904:l0000096c", condition()) - ) - ) - Block("1912:l0000084b", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1904:l0000096c", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/cjump/clang/cjump-before-analysis.il.expected b/src/test/correct/cjump/clang/cjump-before-analysis.il.expected deleted file mode 100644 index e4c97e235..000000000 --- a/src/test/correct/cjump/clang/cjump-before-analysis.il.expected +++ /dev/null @@ -1,374 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000398", condition()) - ) - ) - Block("1752:l00000398", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000003a6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003bf", condition()) - ) - ) - Block("1764:l000003bf", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000003a6", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000003b2", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002d5", condition()) - ) - ) - Block("1788:l000002d5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1896:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000005a7", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001ff", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000661", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000040f", condition()) - ) - ) - Block("1604:l00000215", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000040f", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003f1", condition()) - ) - ) - Block("1640:l000003f1", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000404", condition()) - ) - ) - Block("1660:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000404", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000343", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("?:l00000346", condition()) - ) - ) - Block("?:l00000346", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000349", condition()) - ) - ) - Block("?:l00000343", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000349", condition()) - ) - ) - Block("?:l00000349", - statements( - ), - jumps( - GoTo("1868:l00000351", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1848:l0000037e", condition()) - ) - ) - Block("1868:l00000351", - statements( - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1884:l00000369", condition()) - ) - ) - Block("1848:l0000037e", - statements( - ), - jumps( - GoTo("1852:l0000037f", condition()) - ) - ) - Block("1852:l0000037f", - statements( - LocalAssign(Register(R8, bv64) := 3bv64) - LocalAssign(Register(R9, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1884:l00000369", condition()) - ) - ) - Block("1884:l00000369", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003d3", condition()) - ) - ) - Block("1700:l000003d3", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003e6", condition()) - ) - ) - Block("1720:l00000296", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003e6", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/cjump/clang_O2/cjump-before-analysis.il.expected b/src/test/correct/cjump/clang_O2/cjump-before-analysis.il.expected deleted file mode 100644 index 4647f230f..000000000 --- a/src/test/correct/cjump/clang_O2/cjump-before-analysis.il.expected +++ /dev/null @@ -1,308 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002a1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002f8", condition()) - ) - ) - Block("1752:l000002f8", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000306", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000031f", condition()) - ) - ) - Block("1764:l0000031f", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000306", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000312", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002a1", condition()) - ) - ) - Block("1788:l000002a1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1844:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004fa", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001cb", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005a6", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001e1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000036f", condition()) - ) - ) - Block("1604:l000001e1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000036f", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000351", condition()) - ) - ) - Block("1640:l00000351", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000364", condition()) - ) - ) - Block("1660:l00000226", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000364", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 1bv64) - LocalAssign(Register(R10, bv64) := 69632bv64) - LocalAssign(Register(R11, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R10, bv64), 56bv64)] := Extract(Register(R11, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000333", condition()) - ) - ) - Block("1700:l00000333", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000346", condition()) - ) - ) - Block("1720:l00000262", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000346", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/cjump/clang_no_plt_no_pic/cjump-before-analysis.il.expected b/src/test/correct/cjump/clang_no_plt_no_pic/cjump-before-analysis.il.expected deleted file mode 100644 index 1196d843b..000000000 --- a/src/test/correct/cjump/clang_no_plt_no_pic/cjump-before-analysis.il.expected +++ /dev/null @@ -1,374 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000092b", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000009ee", condition()) - ) - ) - Block("1752:l000009ee", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000009fc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000a15", condition()) - ) - ) - Block("1764:l00000a15", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000009fc", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000a08", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000092b", condition()) - ) - ) - Block("1788:l0000092b", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1896:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000bfd", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000855", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c94", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000086b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a65", condition()) - ) - ) - Block("1604:l0000086b", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a65", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000008b0", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000a47", condition()) - ) - ) - Block("1640:l00000a47", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l000008b0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a5a", condition()) - ) - ) - Block("1660:l000008b0", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a5a", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000999", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("?:l0000099c", condition()) - ) - ) - Block("?:l0000099c", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l0000099f", condition()) - ) - ) - Block("?:l00000999", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l0000099f", condition()) - ) - ) - Block("?:l0000099f", - statements( - ), - jumps( - GoTo("1868:l000009a7", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1848:l000009d4", condition()) - ) - ) - Block("1868:l000009a7", - statements( - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1884:l000009bf", condition()) - ) - ) - Block("1848:l000009d4", - statements( - ), - jumps( - GoTo("1852:l000009d5", condition()) - ) - ) - Block("1852:l000009d5", - statements( - LocalAssign(Register(R8, bv64) := 3bv64) - LocalAssign(Register(R9, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1884:l000009bf", condition()) - ) - ) - Block("1884:l000009bf", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008ec", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000a29", condition()) - ) - ) - Block("1700:l00000a29", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000008ec", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000a3c", condition()) - ) - ) - Block("1720:l000008ec", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000a3c", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/cjump/clang_pic/cjump-before-analysis.il.expected b/src/test/correct/cjump/clang_pic/cjump-before-analysis.il.expected deleted file mode 100644 index 63f4053e8..000000000 --- a/src/test/correct/cjump/clang_pic/cjump-before-analysis.il.expected +++ /dev/null @@ -1,377 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002e1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000003b9", condition()) - ) - ) - Block("1816:l000003b9", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) - ), - jumps( - GoTo("1840:l000003c7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l000003e0", condition()) - ) - ) - Block("1828:l000003e0", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l000003c7", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000003d3", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002e1", condition()) - ) - ) - Block("1852:l000002e1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1972:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1972:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l00000567", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l0000020b", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l0000060b", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1668:l00000221", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000430", condition()) - ) - ) - Block("1668:l00000221", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000430", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000412", condition()) - ) - ) - Block("1704:l00000412", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) - ), - jumps( - GoTo("1724:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000425", condition()) - ) - ) - Block("1724:l00000266", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000425", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) - LocalAssign(Register(R9, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R9, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000356", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("?:l00000359", condition()) - ) - ) - Block("?:l00000359", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l0000035c", condition()) - ) - ) - Block("?:l00000356", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l0000035c", condition()) - ) - ) - Block("?:l0000035c", - statements( - ), - jumps( - GoTo("1940:l00000364", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1916:l00000398", condition()) - ) - ) - Block("1940:l00000364", - statements( - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4048bv64)])) - LocalAssign(Register(R8, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1960:l00000383", condition()) - ) - ) - Block("1916:l00000398", - statements( - ), - jumps( - GoTo("1920:l00000399", condition()) - ) - ) - Block("1920:l00000399", - statements( - LocalAssign(Register(R8, bv64) := 3bv64) - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4048bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1960:l00000383", condition()) - ) - ) - Block("1960:l00000383", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002a2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003f4", condition()) - ) - ) - Block("1764:l000003f4", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l000002a2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000407", condition()) - ) - ) - Block("1784:l000002a2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000407", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/cjump/gcc/cjump-before-analysis.il.expected b/src/test/correct/cjump/gcc/cjump-before-analysis.il.expected deleted file mode 100644 index 0426467dd..000000000 --- a/src/test/correct/cjump/gcc/cjump-before-analysis.il.expected +++ /dev/null @@ -1,344 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002d1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000381", condition()) - ) - ) - Block("1752:l00000381", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l0000038f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003a8", condition()) - ) - ) - Block("1764:l000003a8", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000038f", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000039b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002d1", condition()) - ) - ) - Block("1788:l000002d1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1892:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1892:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l0000058f", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001fb", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000649", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000211", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003f8", condition()) - ) - ) - Block("1604:l00000211", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003f8", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003da", condition()) - ) - ) - Block("1640:l000003da", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003ed", condition()) - ) - ) - Block("1660:l00000256", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003ed", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1868:l0000033e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1848:l00000365", condition()) - ) - ) - Block("1868:l0000033e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - GoTo("1884:l0000035b", condition()) - ) - ) - Block("1848:l00000365", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - GoTo("1884:l0000035b", condition()) - ) - ) - Block("1884:l0000035b", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003bc", condition()) - ) - ) - Block("1700:l000003bc", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003cf", condition()) - ) - ) - Block("1720:l00000292", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003cf", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/cjump/gcc_O2/cjump-before-analysis.il.expected b/src/test/correct/cjump/gcc_O2/cjump-before-analysis.il.expected deleted file mode 100644 index 098ce384c..000000000 --- a/src/test/correct/cjump/gcc_O2/cjump-before-analysis.il.expected +++ /dev/null @@ -1,308 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l00000300", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000329", condition()) - ) - ) - Block("1816:l00000329", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l00000337", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000350", condition()) - ) - ) - Block("1828:l00000350", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000337", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000343", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l00000300", condition()) - ) - ) - Block("1852:l00000300", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l00000533", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l0000022a", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005e7", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000240", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003a0", condition()) - ) - ) - Block("1668:l00000240", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003a0", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000285", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000382", condition()) - ) - ) - Block("1704:l00000382", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000285", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000395", condition()) - ) - ) - Block("1724:l00000285", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000395", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R3, bv64) := 1bv64) - LocalAssign(Register(R2, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R0, bv64), 20bv64)] := Extract(Register(R3, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 4bv64)] := Extract(Register(R2, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000364", condition()) - ) - ) - Block("1764:l00000364", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000377", condition()) - ) - ) - Block("1784:l000002c1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000377", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/cjump/gcc_no_plt_no_pic/cjump-before-analysis.il.expected b/src/test/correct/cjump/gcc_no_plt_no_pic/cjump-before-analysis.il.expected deleted file mode 100644 index c9d5fd639..000000000 --- a/src/test/correct/cjump/gcc_no_plt_no_pic/cjump-before-analysis.il.expected +++ /dev/null @@ -1,344 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000090f", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000009bf", condition()) - ) - ) - Block("1752:l000009bf", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000009cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009e6", condition()) - ) - ) - Block("1764:l000009e6", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000009cd", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009d9", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000090f", condition()) - ) - ) - Block("1788:l0000090f", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1892:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1892:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000bcd", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000839", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c63", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l0000084f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a36", condition()) - ) - ) - Block("1604:l0000084f", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a36", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000894", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000a18", condition()) - ) - ) - Block("1640:l00000a18", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000894", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a2b", condition()) - ) - ) - Block("1660:l00000894", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a2b", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1868:l0000097c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1848:l000009a3", condition()) - ) - ) - Block("1868:l0000097c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - GoTo("1884:l00000999", condition()) - ) - ) - Block("1848:l000009a3", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - GoTo("1884:l00000999", condition()) - ) - ) - Block("1884:l00000999", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008d0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009fa", condition()) - ) - ) - Block("1700:l000009fa", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000008d0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000a0d", condition()) - ) - ) - Block("1720:l000008d0", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000a0d", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/cjump/gcc_pic/cjump-before-analysis.il.expected b/src/test/correct/cjump/gcc_pic/cjump-before-analysis.il.expected deleted file mode 100644 index 46cddab65..000000000 --- a/src/test/correct/cjump/gcc_pic/cjump-before-analysis.il.expected +++ /dev/null @@ -1,344 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002d1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000385", condition()) - ) - ) - Block("1816:l00000385", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1840:l00000393", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l000003ac", condition()) - ) - ) - Block("1828:l000003ac", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000393", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000039f", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002d1", condition()) - ) - ) - Block("1852:l000002d1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1956:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1956:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l00000533", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001fb", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l000005d4", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1668:l00000211", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003fc", condition()) - ) - ) - Block("1668:l00000211", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003fc", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003de", condition()) - ) - ) - Block("1704:l000003de", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) - ), - jumps( - GoTo("1724:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003f1", condition()) - ) - ) - Block("1724:l00000256", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003f1", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1932:l00000340", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1912:l00000368", condition()) - ) - ) - Block("1932:l00000340", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - LocalAssign(Register(R1, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - GoTo("1948:l0000035e", condition()) - ) - ) - Block("1912:l00000368", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - LocalAssign(Register(R1, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - GoTo("1948:l0000035e", condition()) - ) - ) - Block("1948:l0000035e", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003c0", condition()) - ) - ) - Block("1764:l000003c0", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003d3", condition()) - ) - ) - Block("1784:l00000292", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003d3", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/function/clang/function-before-analysis.il.expected b/src/test/correct/function/clang/function-before-analysis.il.expected deleted file mode 100644 index 4d53dcfd6..000000000 --- a/src/test/correct/function/clang/function-before-analysis.il.expected +++ /dev/null @@ -1,333 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008a8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000937", condition()) - ) - ) - Block("1752:l00000937", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000945", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000095e", condition()) - ) - ) - Block("1764:l0000095e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000945", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000951", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008a8", condition()) - ) - ) - Block("1788:l000008a8", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1864:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1864:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b3e", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007d2", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000bcd", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000007e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000009ae", condition()) - ) - ) - Block("1604:l000007e8", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000009ae", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000082d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000990", condition()) - ) - ) - Block("1640:l00000990", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000082d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009a3", condition()) - ) - ) - Block("1660:l0000082d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009a3", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1856:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:lget_two", - statements( - LocalAssign(Register(R0, bv64) := 2bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 1836bv64) - ), - jumps( - DirectCall("1856:get_two", condition()) - ) - ) - Block("1836:l00000910", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000869", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000972", condition()) - ) - ) - Block("1700:l00000972", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000869", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000985", condition()) - ) - ) - Block("1720:l00000869", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000985", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/function/clang_O2/function-before-analysis.il.expected b/src/test/correct/function/clang_O2/function-before-analysis.il.expected deleted file mode 100644 index b92c99a72..000000000 --- a/src/test/correct/function/clang_O2/function-before-analysis.il.expected +++ /dev/null @@ -1,318 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002a9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000030a", condition()) - ) - ) - Block("1752:l0000030a", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000318", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000331", condition()) - ) - ) - Block("1764:l00000331", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000318", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000324", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002a9", condition()) - ) - ) - Block("1788:l000002a9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1852:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1852:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l0000050e", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001d3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005be", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001e9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000381", condition()) - ) - ) - Block("1604:l000001e9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000381", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000022e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000363", condition()) - ) - ) - Block("1640:l00000363", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000022e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000376", condition()) - ) - ) - Block("1660:l0000022e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000376", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1844:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lget_two", - statements( - LocalAssign(Register(R0, bv64) := 2bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 1bv64) - LocalAssign(Register(R10, bv64) := 69632bv64) - LocalAssign(Register(R11, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R10, bv64), 56bv64)] := Extract(Register(R11, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000026a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000345", condition()) - ) - ) - Block("1700:l00000345", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000026a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000358", condition()) - ) - ) - Block("1720:l0000026a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000358", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/function/clang_no_plt_no_pic/function-before-analysis.il.expected b/src/test/correct/function/clang_no_plt_no_pic/function-before-analysis.il.expected deleted file mode 100644 index 4d53dcfd6..000000000 --- a/src/test/correct/function/clang_no_plt_no_pic/function-before-analysis.il.expected +++ /dev/null @@ -1,333 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008a8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000937", condition()) - ) - ) - Block("1752:l00000937", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000945", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000095e", condition()) - ) - ) - Block("1764:l0000095e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000945", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000951", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008a8", condition()) - ) - ) - Block("1788:l000008a8", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1864:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1864:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b3e", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007d2", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000bcd", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000007e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000009ae", condition()) - ) - ) - Block("1604:l000007e8", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000009ae", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000082d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000990", condition()) - ) - ) - Block("1640:l00000990", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000082d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009a3", condition()) - ) - ) - Block("1660:l0000082d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009a3", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1856:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:lget_two", - statements( - LocalAssign(Register(R0, bv64) := 2bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 1836bv64) - ), - jumps( - DirectCall("1856:get_two", condition()) - ) - ) - Block("1836:l00000910", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000869", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000972", condition()) - ) - ) - Block("1700:l00000972", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000869", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000985", condition()) - ) - ) - Block("1720:l00000869", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000985", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/function/clang_pic/function-before-analysis.il.expected b/src/test/correct/function/clang_pic/function-before-analysis.il.expected deleted file mode 100644 index 999b2435a..000000000 --- a/src/test/correct/function/clang_pic/function-before-analysis.il.expected +++ /dev/null @@ -1,335 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000035a", condition()) - ) - ) - Block("1816:l0000035a", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) - ), - jumps( - GoTo("1840:l00000368", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000381", condition()) - ) - ) - Block("1828:l00000381", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000368", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000374", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002bd", condition()) - ) - ) - Block("1852:l000002bd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1936:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1936:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l00000508", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001e7", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l000005a4", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1668:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003d1", condition()) - ) - ) - Block("1668:l000001fd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003d1", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003b3", condition()) - ) - ) - Block("1704:l000003b3", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) - ), - jumps( - GoTo("1724:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003c6", condition()) - ) - ) - Block("1724:l00000242", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003c6", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1928:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1928:lget_two", - statements( - LocalAssign(Register(R0, bv64) := 2bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4032bv64)])) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 1904bv64) - ), - jumps( - DirectCall("1928:get_two", condition()) - ) - ) - Block("1904:l0000032c", - statements( - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4048bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000395", condition()) - ) - ) - Block("1764:l00000395", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003a8", condition()) - ) - ) - Block("1784:l0000027e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003a8", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/function/gcc/function-before-analysis.il.expected b/src/test/correct/function/gcc/function-before-analysis.il.expected deleted file mode 100644 index 709205956..000000000 --- a/src/test/correct/function/gcc/function-before-analysis.il.expected +++ /dev/null @@ -1,336 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008d8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000979", condition()) - ) - ) - Block("1752:l00000979", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000987", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009a0", condition()) - ) - ) - Block("1764:l000009a0", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000987", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000993", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008d8", condition()) - ) - ) - Block("1788:l000008d8", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b83", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000802", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c15", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000818", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000009f0", condition()) - ) - ) - Block("1604:l00000818", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000009f0", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009d2", condition()) - ) - ) - Block("1640:l000009d2", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009e5", condition()) - ) - ) - Block("1660:l0000085d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009e5", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1868:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1868:lget_two", - statements( - LocalAssign(Register(R0, bv64) := 2bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1868:get_two", condition()) - ) - ) - Block("1840:l00000946", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000899", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009b4", condition()) - ) - ) - Block("1700:l000009b4", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000899", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009c7", condition()) - ) - ) - Block("1720:l00000899", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009c7", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/function/gcc_O2/function-before-analysis.il.expected b/src/test/correct/function/gcc_O2/function-before-analysis.il.expected deleted file mode 100644 index 03a119e35..000000000 --- a/src/test/correct/function/gcc_O2/function-before-analysis.il.expected +++ /dev/null @@ -1,318 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l00000314", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000034d", condition()) - ) - ) - Block("1816:l0000034d", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000035b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000374", condition()) - ) - ) - Block("1828:l00000374", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000035b", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000367", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l00000314", condition()) - ) - ) - Block("1852:l00000314", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1896:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l0000055c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l0000023e", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000617", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000254", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003c4", condition()) - ) - ) - Block("1668:l00000254", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003c4", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000299", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003a6", condition()) - ) - ) - Block("1704:l000003a6", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000299", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003b9", condition()) - ) - ) - Block("1724:l00000299", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003b9", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1888:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1888:lget_two", - statements( - LocalAssign(Register(R0, bv64) := 2bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R3, bv64) := 1bv64) - LocalAssign(Register(R2, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R0, bv64), 20bv64)] := Extract(Register(R3, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 4bv64)] := Extract(Register(R2, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000388", condition()) - ) - ) - Block("1764:l00000388", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000039b", condition()) - ) - ) - Block("1784:l000002d5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000039b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/function/gcc_no_plt_no_pic/function-before-analysis.il.expected b/src/test/correct/function/gcc_no_plt_no_pic/function-before-analysis.il.expected deleted file mode 100644 index 709205956..000000000 --- a/src/test/correct/function/gcc_no_plt_no_pic/function-before-analysis.il.expected +++ /dev/null @@ -1,336 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008d8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000979", condition()) - ) - ) - Block("1752:l00000979", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000987", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009a0", condition()) - ) - ) - Block("1764:l000009a0", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000987", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000993", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008d8", condition()) - ) - ) - Block("1788:l000008d8", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b83", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000802", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c15", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000818", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000009f0", condition()) - ) - ) - Block("1604:l00000818", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000009f0", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009d2", condition()) - ) - ) - Block("1640:l000009d2", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009e5", condition()) - ) - ) - Block("1660:l0000085d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009e5", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1868:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1868:lget_two", - statements( - LocalAssign(Register(R0, bv64) := 2bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1868:get_two", condition()) - ) - ) - Block("1840:l00000946", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000899", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009b4", condition()) - ) - ) - Block("1700:l000009b4", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000899", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009c7", condition()) - ) - ) - Block("1720:l00000899", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009c7", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/function/gcc_pic/function-before-analysis.il.expected b/src/test/correct/function/gcc_pic/function-before-analysis.il.expected deleted file mode 100644 index 5c0173591..000000000 --- a/src/test/correct/function/gcc_pic/function-before-analysis.il.expected +++ /dev/null @@ -1,336 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002c1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000364", condition()) - ) - ) - Block("1816:l00000364", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1840:l00000372", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000038b", condition()) - ) - ) - Block("1828:l0000038b", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000372", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000037e", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002c1", condition()) - ) - ) - Block("1852:l000002c1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1940:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1940:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l00000512", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001eb", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l000005af", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1668:l00000201", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003db", condition()) - ) - ) - Block("1668:l00000201", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003db", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003bd", condition()) - ) - ) - Block("1704:l000003bd", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) - ), - jumps( - GoTo("1724:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003d0", condition()) - ) - ) - Block("1724:l00000246", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003d0", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1932:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1932:lget_two", - statements( - LocalAssign(Register(R0, bv64) := 2bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 1904bv64) - ), - jumps( - DirectCall("1932:get_two", condition()) - ) - ) - Block("1904:l00000330", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000039f", condition()) - ) - ) - Block("1764:l0000039f", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003b2", condition()) - ) - ) - Block("1784:l00000282", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003b2", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/function1/clang/function1-before-analysis.il.expected b/src/test/correct/function1/clang/function1-before-analysis.il.expected deleted file mode 100644 index 606bfb205..000000000 --- a/src/test/correct/function1/clang/function1-before-analysis.il.expected +++ /dev/null @@ -1,361 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) - ), - jumps( - GoTo("1852:l00000301", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000040f", condition()) - ) - ) - Block("1816:l0000040f", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1840:l0000041d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000436", condition()) - ) - ) - Block("1828:l00000436", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000041d", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000429", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l00000301", condition()) - ) - ) - Block("1852:l00000301", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2004:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2004:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1464:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1480bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1480:l0000064f", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l0000022b", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l0000071c", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l00000241", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000486", condition()) - ) - ) - Block("1668:l00000241", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000486", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000468", condition()) - ) - ) - Block("1704:l00000468", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1724:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l0000047b", condition()) - ) - ) - Block("1724:l00000286", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l0000047b", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:lget_two", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R1, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R2, bv64))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R9, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), Extract(Register(R9, bv64)[32:0])), 32)) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R8, bv64) := BinaryExpr("add", Register(R8, bv64), SignExtend(Extract(Register(R9, bv64)[32:0]), 32))) - LocalAssign(Register(R0, bv64) := ZeroExtend(Extract(Register(R8, bv64)[32:0]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1924:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1924:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 60bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 97bv64) - LocalAssign(Register(R1, bv64) := 10bv64) - LocalAssign(Register(R2, bv64) := 58368bv64) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:32]), BinaryExpr("++", 21515bv16, Extract(Register(R2, bv64)[16:0])))) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:48]), BinaryExpr("++", 2bv16, Extract(Register(R2, bv64)[32:0])))) - LocalAssign(Register(R30, bv64) := 1968bv64) - ), - jumps( - DirectCall("1876:get_two", condition()) - ) - ) - Block("1968:l000003ce", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 64bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 64bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2028bv64)) - LocalAssign(Register(R30, bv64) := 1992bv64) - ), - jumps( - DirectCall("1584:printf", condition()) - ) - ) - Block("1992:l000003f5", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1584:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002c2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000044a", condition()) - ) - ) - Block("1764:l0000044a", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l000002c2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000045d", condition()) - ) - ) - Block("1784:l000002c2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000045d", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/function1/clang_O2/function1-before-analysis.il.expected b/src/test/correct/function1/clang_O2/function1-before-analysis.il.expected deleted file mode 100644 index 5356989a2..000000000 --- a/src/test/correct/function1/clang_O2/function1-before-analysis.il.expected +++ /dev/null @@ -1,342 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002d1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000038b", condition()) - ) - ) - Block("1816:l0000038b", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1840:l00000399", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l000003b2", condition()) - ) - ) - Block("1828:l000003b2", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000399", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000003a5", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002d1", condition()) - ) - ) - Block("1852:l000002d1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1956:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1956:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1464:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1480bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1480:l000005bf", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001fb", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l00000680", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l00000211", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000402", condition()) - ) - ) - Block("1668:l00000211", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000402", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003e4", condition()) - ) - ) - Block("1704:l000003e4", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1724:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003f7", condition()) - ) - ) - Block("1724:l00000256", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003f7", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:lget_two", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R1, bv64)[32:0]), BinaryExpr("++", 0bv24, Extract(Register(R0, bv64)[8:0]))), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), Extract(Register(R2, bv64)[32:0])), 32)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1888:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1888:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R11, bv64) := 58475bv64) - LocalAssign(Register(R1, bv64) := 58475bv64) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 1bv64) - LocalAssign(Register(R10, bv64) := 69632bv64) - LocalAssign(Register(R11, bv64) := ZeroExtend(BinaryExpr("++", 21515bv16, Extract(Register(R11, bv64)[16:0])), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1980bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("++", 21515bv16, Extract(Register(R1, bv64)[16:0])), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 60bv64)] := Extract(Register(R9, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R10, bv64), 64bv64)] := Extract(Register(R11, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 1944bv64) - ), - jumps( - DirectCall("1584:printf", condition()) - ) - ) - Block("1944:l00000371", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1584:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003c6", condition()) - ) - ) - Block("1764:l000003c6", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003d9", condition()) - ) - ) - Block("1784:l00000292", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003d9", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/function1/clang_no_plt_no_pic/function1-before-analysis.il.expected b/src/test/correct/function1/clang_no_plt_no_pic/function1-before-analysis.il.expected deleted file mode 100644 index 74d92e622..000000000 --- a/src/test/correct/function1/clang_no_plt_no_pic/function1-before-analysis.il.expected +++ /dev/null @@ -1,361 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) - ), - jumps( - GoTo("1852:l00000a12", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000b20", condition()) - ) - ) - Block("1816:l00000b20", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1840:l00000b2e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000b47", condition()) - ) - ) - Block("1828:l00000b47", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000b2e", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000b3a", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l00000a12", condition()) - ) - ) - Block("1852:l00000a12", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2004:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2004:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1464:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1480bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1480:l00000d60", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l0000093c", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l00000e06", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l00000952", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000b97", condition()) - ) - ) - Block("1668:l00000952", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000b97", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000997", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000b79", condition()) - ) - ) - Block("1704:l00000b79", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1724:l00000997", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000b8c", condition()) - ) - ) - Block("1724:l00000997", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000b8c", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:lget_two", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R1, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R2, bv64))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R9, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), Extract(Register(R9, bv64)[32:0])), 32)) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R8, bv64) := BinaryExpr("add", Register(R8, bv64), SignExtend(Extract(Register(R9, bv64)[32:0]), 32))) - LocalAssign(Register(R0, bv64) := ZeroExtend(Extract(Register(R8, bv64)[32:0]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1924:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1924:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 60bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 97bv64) - LocalAssign(Register(R1, bv64) := 10bv64) - LocalAssign(Register(R2, bv64) := 58368bv64) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:32]), BinaryExpr("++", 21515bv16, Extract(Register(R2, bv64)[16:0])))) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:48]), BinaryExpr("++", 2bv16, Extract(Register(R2, bv64)[32:0])))) - LocalAssign(Register(R30, bv64) := 1968bv64) - ), - jumps( - DirectCall("1876:get_two", condition()) - ) - ) - Block("1968:l00000adf", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 64bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 64bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2028bv64)) - LocalAssign(Register(R30, bv64) := 1992bv64) - ), - jumps( - DirectCall("1584:printf", condition()) - ) - ) - Block("1992:l00000b06", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1584:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000009d3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000b5b", condition()) - ) - ) - Block("1764:l00000b5b", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l000009d3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000b6e", condition()) - ) - ) - Block("1784:l000009d3", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000b6e", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/function1/clang_pic/function1-before-analysis.il.expected b/src/test/correct/function1/clang_pic/function1-before-analysis.il.expected deleted file mode 100644 index fee1a805a..000000000 --- a/src/test/correct/function1/clang_pic/function1-before-analysis.il.expected +++ /dev/null @@ -1,363 +0,0 @@ -Procedure("1584:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1856:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) - ), - jumps( - GoTo("1916:l00000309", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1880:l00000425", condition()) - ) - ) - Block("1880:l00000425", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) - ), - jumps( - GoTo("1904:l00000433", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1892:l0000044c", condition()) - ) - ) - Block("1892:l0000044c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) - LocalAssign(Register(R30, bv64) := 1904bv64) - ), - jumps( - DirectCall("1584:__cxa_finalize", condition()) - ) - ) - Block("1904:l00000433", - statements( - LocalAssign(Register(R30, bv64) := 1908bv64) - ), - jumps( - DirectCall("1744:deregister_tm_clones", condition()) - ) - ) - Block("1908:l0000043f", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1916:l00000309", condition()) - ) - ) - Block("1916:l00000309", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1568:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1568:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2076:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2076:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1512:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1512:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1528bv64) - ), - jumps( - DirectCall("1716:call_weak_fn", condition()) - ) - ) - Block("1528:l000005f9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1712bv64) - ), - jumps( - DirectCall("1568:__libc_start_main", condition()) - ) - ) - Block("1712:l00000233", - statements( - LocalAssign(Register(R30, bv64) := 1716bv64) - ), - jumps( - DirectCall("1616:abort", condition()) - ) - ) - Block("?:l000006c8", - statements( - ), - jumps( - DirectCall("1716:call_weak_fn", condition()) - ) - ) -)), -Procedure("1616:abort", in(), out(), blocks( -)), -Procedure("1716:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1716:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1732:l00000249", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1728:l0000049c", condition()) - ) - ) - Block("1732:l00000249", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1728:l0000049c", - statements( - ), - jumps( - GoTo("1600:l__gmon_start__", condition()) - ) - ) - Block("1600:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1744:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1744:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1788:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1768:l0000047e", condition()) - ) - ) - Block("1768:l0000047e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) - ), - jumps( - GoTo("1788:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1780:l00000491", condition()) - ) - ) - Block("1788:l0000028e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1780:l00000491", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1936:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1936:lframe_dummy", - statements( - ), - jumps( - DirectCall("1792:register_tm_clones", condition()) - ) - ) -)), -Procedure("1940:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1940:lget_two", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R1, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R2, bv64))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R9, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), Extract(Register(R9, bv64)[32:0])), 32)) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R8, bv64) := BinaryExpr("add", Register(R8, bv64), SignExtend(Extract(Register(R9, bv64)[32:0]), 32))) - LocalAssign(Register(R0, bv64) := ZeroExtend(Extract(Register(R8, bv64)[32:0]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1988:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1988:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4032bv64)])) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 97bv64) - LocalAssign(Register(R1, bv64) := 10bv64) - LocalAssign(Register(R2, bv64) := 58368bv64) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:32]), BinaryExpr("++", 21515bv16, Extract(Register(R2, bv64)[16:0])))) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:48]), BinaryExpr("++", 2bv16, Extract(Register(R2, bv64)[32:0])))) - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1940:get_two", condition()) - ) - ) - Block("2036:l000003dd", - statements( - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4048bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2100bv64)) - LocalAssign(Register(R30, bv64) := 2064bv64) - ), - jumps( - DirectCall("1632:printf", condition()) - ) - ) - Block("2064:l0000040b", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1848:l000002ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000460", condition()) - ) - ) - Block("1828:l00000460", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1848:l000002ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1840:l00000473", condition()) - ) - ) - Block("1848:l000002ca", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1840:l00000473", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/function1/gcc/function1-before-analysis.il.expected b/src/test/correct/function1/gcc/function1-before-analysis.il.expected deleted file mode 100644 index a63150732..000000000 --- a/src/test/correct/function1/gcc/function1-before-analysis.il.expected +++ /dev/null @@ -1,367 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l00000319", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000044a", condition()) - ) - ) - Block("1816:l0000044a", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l00000458", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000471", condition()) - ) - ) - Block("1828:l00000471", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000458", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000464", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l00000319", condition()) - ) - ) - Block("1852:l00000319", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2028:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2028:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1464:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1480bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1480:l00000690", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l00000243", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l00000763", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000259", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000004c1", condition()) - ) - ) - Block("1668:l00000259", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000004c1", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000029e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000004a3", condition()) - ) - ) - Block("1704:l000004a3", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l0000029e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000004b6", condition()) - ) - ) - Block("1724:l0000029e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000004b6", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:lget_two", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R1, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R2, bv64))) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1924:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1924:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R2, bv64) := 58368bv64) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:32]), BinaryExpr("++", 21515bv16, Extract(Register(R2, bv64)[16:0])))) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:48]), BinaryExpr("++", 2bv16, Extract(Register(R2, bv64)[32:0])))) - LocalAssign(Register(R1, bv64) := 10bv64) - LocalAssign(Register(R0, bv64) := 97bv64) - LocalAssign(Register(R30, bv64) := 1972bv64) - ), - jumps( - DirectCall("1876:get_two", condition()) - ) - ) - Block("1972:l000003ec", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2056bv64)) - LocalAssign(Register(R30, bv64) := 2016bv64) - ), - jumps( - DirectCall("1584:printf", condition()) - ) - ) - Block("2016:l00000430", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1584:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002da", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000485", condition()) - ) - ) - Block("1764:l00000485", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002da", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000498", condition()) - ) - ) - Block("1784:l000002da", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000498", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/function1/gcc_O2/function1-before-analysis.il.expected b/src/test/correct/function1/gcc_O2/function1-before-analysis.il.expected deleted file mode 100644 index c5fc4e0e3..000000000 --- a/src/test/correct/function1/gcc_O2/function1-before-analysis.il.expected +++ /dev/null @@ -1,340 +0,0 @@ -Procedure("1552:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1980:l0000034f", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1944:l00000391", condition()) - ) - ) - Block("1944:l00000391", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1968:l0000039f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1956:l000003b8", condition()) - ) - ) - Block("1956:l000003b8", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1968bv64) - ), - jumps( - DirectCall("1552:__cxa_finalize", condition()) - ) - ) - Block("1968:l0000039f", - statements( - LocalAssign(Register(R30, bv64) := 1972bv64) - ), - jumps( - DirectCall("1808:deregister_tm_clones", condition()) - ) - ) - Block("1972:l000003ab", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1980:l0000034f", condition()) - ) - ) - Block("1980:l0000034f", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1568:__printf_chk", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2028:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2028:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1472:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1488bv64) - ), - jumps( - DirectCall("1780:call_weak_fn", condition()) - ) - ) - Block("1488:l00000565", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1536:__libc_start_main", condition()) - ) - ) - Block("1776:l00000279", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1600:abort", condition()) - ) - ) - Block("?:l0000060a", - statements( - ), - jumps( - DirectCall("1780:call_weak_fn", condition()) - ) - ) -)), -Procedure("1600:abort", in(), out(), blocks( -)), -Procedure("1780:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1780:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1796:l0000028f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1792:l00000408", condition()) - ) - ) - Block("1796:l0000028f", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1792:l00000408", - statements( - ), - jumps( - GoTo("1584:l__gmon_start__", condition()) - ) - ) - Block("1584:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1808:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1852:l000002d4", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1832:l000003ea", condition()) - ) - ) - Block("1832:l000003ea", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1852:l000002d4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1844:l000003fd", condition()) - ) - ) - Block("1852:l000002d4", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1844:l000003fd", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2000:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2000:lframe_dummy", - statements( - ), - jumps( - DirectCall("1856:register_tm_clones", condition()) - ) - ) -)), -Procedure("2016:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2016:lget_two", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R1, bv64)[32:0]), BinaryExpr("++", 0bv24, Extract(Register(R0, bv64)[8:0]))), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), Extract(Register(R2, bv64)[32:0])), 32)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1664:lmain", - statements( - LocalAssign(LocalVar(#1, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#1, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#1, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#1, bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R3, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R2, bv64) := 58475bv64) - LocalAssign(Register(R2, bv64) := ZeroExtend(BinaryExpr("++", 21515bv16, Extract(Register(R2, bv64)[16:0])), 32)) - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R1, bv64) := 0bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2056bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R3, bv64), 4bv64)] := Extract(Register(R2, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 1712bv64) - ), - jumps( - DirectCall("1568:__printf_chk", condition()) - ) - ) - Block("1712:l0000021a", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1856:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1912:l00000310", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1892:l000003cc", condition()) - ) - ) - Block("1892:l000003cc", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1912:l00000310", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1904:l000003df", condition()) - ) - ) - Block("1912:l00000310", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1904:l000003df", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/function1/gcc_no_plt_no_pic/function1-before-analysis.il.expected b/src/test/correct/function1/gcc_no_plt_no_pic/function1-before-analysis.il.expected deleted file mode 100644 index c4ce73681..000000000 --- a/src/test/correct/function1/gcc_no_plt_no_pic/function1-before-analysis.il.expected +++ /dev/null @@ -1,367 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l00000a71", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000ba2", condition()) - ) - ) - Block("1816:l00000ba2", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l00000bb0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000bc9", condition()) - ) - ) - Block("1828:l00000bc9", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000bb0", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000bbc", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l00000a71", condition()) - ) - ) - Block("1852:l00000a71", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2028:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2028:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1464:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1480bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1480:l00000de8", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l0000099b", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l00000e94", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l000009b1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000c19", condition()) - ) - ) - Block("1668:l000009b1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000c19", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l000009f6", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000bfb", condition()) - ) - ) - Block("1704:l00000bfb", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l000009f6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000c0e", condition()) - ) - ) - Block("1724:l000009f6", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000c0e", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:lget_two", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R1, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R2, bv64))) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1924:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1924:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R2, bv64) := 58368bv64) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:32]), BinaryExpr("++", 21515bv16, Extract(Register(R2, bv64)[16:0])))) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:48]), BinaryExpr("++", 2bv16, Extract(Register(R2, bv64)[32:0])))) - LocalAssign(Register(R1, bv64) := 10bv64) - LocalAssign(Register(R0, bv64) := 97bv64) - LocalAssign(Register(R30, bv64) := 1972bv64) - ), - jumps( - DirectCall("1876:get_two", condition()) - ) - ) - Block("1972:l00000b44", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2056bv64)) - LocalAssign(Register(R30, bv64) := 2016bv64) - ), - jumps( - DirectCall("1584:printf", condition()) - ) - ) - Block("2016:l00000b88", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1584:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000a32", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000bdd", condition()) - ) - ) - Block("1764:l00000bdd", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l00000a32", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000bf0", condition()) - ) - ) - Block("1784:l00000a32", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000bf0", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/function1/gcc_pic/function1-before-analysis.il.expected b/src/test/correct/function1/gcc_pic/function1-before-analysis.il.expected deleted file mode 100644 index 5b51e5cd9..000000000 --- a/src/test/correct/function1/gcc_pic/function1-before-analysis.il.expected +++ /dev/null @@ -1,367 +0,0 @@ -Procedure("1584:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1856:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1916:l00000319", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1880:l0000044d", condition()) - ) - ) - Block("1880:l0000044d", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1904:l0000045b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1892:l00000474", condition()) - ) - ) - Block("1892:l00000474", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1904bv64) - ), - jumps( - DirectCall("1584:__cxa_finalize", condition()) - ) - ) - Block("1904:l0000045b", - statements( - LocalAssign(Register(R30, bv64) := 1908bv64) - ), - jumps( - DirectCall("1744:deregister_tm_clones", condition()) - ) - ) - Block("1908:l00000467", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1916:l00000319", condition()) - ) - ) - Block("1916:l00000319", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1568:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1568:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2092:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2092:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1512:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1512:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1528bv64) - ), - jumps( - DirectCall("1716:call_weak_fn", condition()) - ) - ) - Block("1528:l00000621", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1712bv64) - ), - jumps( - DirectCall("1568:__libc_start_main", condition()) - ) - ) - Block("1712:l00000243", - statements( - LocalAssign(Register(R30, bv64) := 1716bv64) - ), - jumps( - DirectCall("1616:abort", condition()) - ) - ) - Block("?:l000006f4", - statements( - ), - jumps( - DirectCall("1716:call_weak_fn", condition()) - ) - ) -)), -Procedure("1616:abort", in(), out(), blocks( -)), -Procedure("1716:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1716:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1732:l00000259", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1728:l000004c4", condition()) - ) - ) - Block("1732:l00000259", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1728:l000004c4", - statements( - ), - jumps( - GoTo("1600:l__gmon_start__", condition()) - ) - ) - Block("1600:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1744:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1744:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1788:l0000029e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1768:l000004a6", condition()) - ) - ) - Block("1768:l000004a6", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) - ), - jumps( - GoTo("1788:l0000029e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1780:l000004b9", condition()) - ) - ) - Block("1788:l0000029e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1780:l000004b9", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1936:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1936:lframe_dummy", - statements( - ), - jumps( - DirectCall("1792:register_tm_clones", condition()) - ) - ) -)), -Procedure("1940:get_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1940:lget_two", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R1, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R2, bv64))) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R1, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1988:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1988:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R2, bv64) := 58368bv64) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:32]), BinaryExpr("++", 21515bv16, Extract(Register(R2, bv64)[16:0])))) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", Extract(Register(R2, bv64)[64:48]), BinaryExpr("++", 2bv16, Extract(Register(R2, bv64)[32:0])))) - LocalAssign(Register(R1, bv64) := 10bv64) - LocalAssign(Register(R0, bv64) := 97bv64) - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1940:get_two", condition()) - ) - ) - Block("2036:l000003ed", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2120bv64)) - LocalAssign(Register(R30, bv64) := 2080bv64) - ), - jumps( - DirectCall("1632:printf", condition()) - ) - ) - Block("2080:l00000433", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1848:l000002da", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000488", condition()) - ) - ) - Block("1828:l00000488", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1848:l000002da", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1840:l0000049b", condition()) - ) - ) - Block("1848:l000002da", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1840:l0000049b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/functions_with_params/clang/functions_with_params-before-analysis.il.expected b/src/test/correct/functions_with_params/clang/functions_with_params-before-analysis.il.expected deleted file mode 100644 index ef234d57e..000000000 --- a/src/test/correct/functions_with_params/clang/functions_with_params-before-analysis.il.expected +++ /dev/null @@ -1,339 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002d1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000038e", condition()) - ) - ) - Block("1752:l0000038e", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000039c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003b5", condition()) - ) - ) - Block("1764:l000003b5", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000039c", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000003a8", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002d1", condition()) - ) - ) - Block("1788:l000002d1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1892:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1892:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l0000059c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001fb", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000656", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000211", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000405", condition()) - ) - ) - Block("1604:l00000211", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000405", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003e7", condition()) - ) - ) - Block("1640:l000003e7", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003fa", condition()) - ) - ) - Block("1660:l00000256", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003fa", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)]), 32)) - LocalAssign(Register(R30, bv64) := 1848bv64) - ), - jumps( - DirectCall("1868:plus_one", condition()) - ) - ) - Block("1848:l00000366", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1868:plus_one", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1868:lplus_one", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003c9", condition()) - ) - ) - Block("1700:l000003c9", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003dc", condition()) - ) - ) - Block("1720:l00000292", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003dc", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/functions_with_params/clang_O2/functions_with_params-before-analysis.il.expected b/src/test/correct/functions_with_params/clang_O2/functions_with_params-before-analysis.il.expected deleted file mode 100644 index 7b0c03c4b..000000000 --- a/src/test/correct/functions_with_params/clang_O2/functions_with_params-before-analysis.il.expected +++ /dev/null @@ -1,312 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000291", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002cf", condition()) - ) - ) - Block("1752:l000002cf", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000002f6", condition()) - ) - ) - Block("1764:l000002f6", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002dd", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002e9", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000291", condition()) - ) - ) - Block("1788:l00000291", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1828:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1828:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004cd", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001bb", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000577", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000346", condition()) - ) - ) - Block("1604:l000001d1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000346", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000216", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000328", condition()) - ) - ) - Block("1640:l00000328", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000216", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000033b", condition()) - ) - ) - Block("1660:l00000216", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000033b", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1820:plus_one", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1820:lplus_one", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000030a", condition()) - ) - ) - Block("1700:l0000030a", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000031d", condition()) - ) - ) - Block("1720:l00000252", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000031d", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/functions_with_params/clang_no_plt_no_pic/functions_with_params-before-analysis.il.expected b/src/test/correct/functions_with_params/clang_no_plt_no_pic/functions_with_params-before-analysis.il.expected deleted file mode 100644 index df1be07a9..000000000 --- a/src/test/correct/functions_with_params/clang_no_plt_no_pic/functions_with_params-before-analysis.il.expected +++ /dev/null @@ -1,339 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000091c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000009d9", condition()) - ) - ) - Block("1752:l000009d9", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000009e7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000a00", condition()) - ) - ) - Block("1764:l00000a00", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000009e7", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009f3", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000091c", condition()) - ) - ) - Block("1788:l0000091c", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1892:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1892:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000be7", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000846", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c7d", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000085c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a50", condition()) - ) - ) - Block("1604:l0000085c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a50", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000008a1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000a32", condition()) - ) - ) - Block("1640:l00000a32", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l000008a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a45", condition()) - ) - ) - Block("1660:l000008a1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a45", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)]), 32)) - LocalAssign(Register(R30, bv64) := 1848bv64) - ), - jumps( - DirectCall("1868:plus_one", condition()) - ) - ) - Block("1848:l000009b1", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1868:plus_one", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1868:lplus_one", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000a14", condition()) - ) - ) - Block("1700:l00000a14", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000008dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000a27", condition()) - ) - ) - Block("1720:l000008dd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000a27", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/functions_with_params/clang_pic/functions_with_params-before-analysis.il.expected b/src/test/correct/functions_with_params/clang_pic/functions_with_params-before-analysis.il.expected deleted file mode 100644 index df1be07a9..000000000 --- a/src/test/correct/functions_with_params/clang_pic/functions_with_params-before-analysis.il.expected +++ /dev/null @@ -1,339 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000091c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000009d9", condition()) - ) - ) - Block("1752:l000009d9", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000009e7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000a00", condition()) - ) - ) - Block("1764:l00000a00", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000009e7", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009f3", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000091c", condition()) - ) - ) - Block("1788:l0000091c", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1892:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1892:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000be7", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000846", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c7d", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000085c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a50", condition()) - ) - ) - Block("1604:l0000085c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a50", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000008a1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000a32", condition()) - ) - ) - Block("1640:l00000a32", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l000008a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a45", condition()) - ) - ) - Block("1660:l000008a1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a45", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)]), 32)) - LocalAssign(Register(R30, bv64) := 1848bv64) - ), - jumps( - DirectCall("1868:plus_one", condition()) - ) - ) - Block("1848:l000009b1", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1868:plus_one", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1868:lplus_one", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000a14", condition()) - ) - ) - Block("1700:l00000a14", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000008dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000a27", condition()) - ) - ) - Block("1720:l000008dd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000a27", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/functions_with_params/gcc/functions_with_params-before-analysis.il.expected b/src/test/correct/functions_with_params/gcc/functions_with_params-before-analysis.il.expected deleted file mode 100644 index e5efd9aa7..000000000 --- a/src/test/correct/functions_with_params/gcc/functions_with_params-before-analysis.il.expected +++ /dev/null @@ -1,338 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002c9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000037e", condition()) - ) - ) - Block("1752:l0000037e", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l0000038c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003a5", condition()) - ) - ) - Block("1764:l000003a5", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000038c", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000398", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002c9", condition()) - ) - ) - Block("1788:l000002c9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1884:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1884:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l0000058a", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001f3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000642", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000209", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003f5", condition()) - ) - ) - Block("1604:l00000209", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003f5", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003d7", condition()) - ) - ) - Block("1640:l000003d7", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003ea", condition()) - ) - ) - Block("1660:l0000024e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003ea", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1860:plus_one", condition()) - ) - ) - Block("1844:l0000035c", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1860:plus_one", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1860:lplus_one", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003b9", condition()) - ) - ) - Block("1700:l000003b9", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003cc", condition()) - ) - ) - Block("1720:l0000028a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003cc", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/functions_with_params/gcc_O2/functions_with_params-before-analysis.il.expected b/src/test/correct/functions_with_params/gcc_O2/functions_with_params-before-analysis.il.expected deleted file mode 100644 index 4ed2e878f..000000000 --- a/src/test/correct/functions_with_params/gcc_O2/functions_with_params-before-analysis.il.expected +++ /dev/null @@ -1,312 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002fb", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000335", condition()) - ) - ) - Block("1816:l00000335", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l00000343", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000035c", condition()) - ) - ) - Block("1828:l0000035c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000343", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000034f", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002fb", condition()) - ) - ) - Block("1852:l000002fb", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1896:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l00000544", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000225", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005ff", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l0000023b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003ac", condition()) - ) - ) - Block("1668:l0000023b", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003ac", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000280", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000038e", condition()) - ) - ) - Block("1704:l0000038e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000280", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003a1", condition()) - ) - ) - Block("1724:l00000280", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003a1", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1888:plus_one", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1888:lplus_one", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002bc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000370", condition()) - ) - ) - Block("1764:l00000370", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002bc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000383", condition()) - ) - ) - Block("1784:l000002bc", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000383", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/functions_with_params/gcc_no_plt_no_pic/functions_with_params-before-analysis.il.expected b/src/test/correct/functions_with_params/gcc_no_plt_no_pic/functions_with_params-before-analysis.il.expected deleted file mode 100644 index 67f60a718..000000000 --- a/src/test/correct/functions_with_params/gcc_no_plt_no_pic/functions_with_params-before-analysis.il.expected +++ /dev/null @@ -1,338 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000900", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000009b5", condition()) - ) - ) - Block("1752:l000009b5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000009c3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009dc", condition()) - ) - ) - Block("1764:l000009dc", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000009c3", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009cf", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000900", condition()) - ) - ) - Block("1788:l00000900", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1884:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1884:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000bc1", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000082a", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c55", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000840", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a2c", condition()) - ) - ) - Block("1604:l00000840", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a2c", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000885", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000a0e", condition()) - ) - ) - Block("1640:l00000a0e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000885", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a21", condition()) - ) - ) - Block("1660:l00000885", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a21", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1860:plus_one", condition()) - ) - ) - Block("1844:l00000993", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1860:plus_one", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1860:lplus_one", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009f0", condition()) - ) - ) - Block("1700:l000009f0", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000008c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000a03", condition()) - ) - ) - Block("1720:l000008c1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000a03", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/functions_with_params/gcc_pic/functions_with_params-before-analysis.il.expected b/src/test/correct/functions_with_params/gcc_pic/functions_with_params-before-analysis.il.expected deleted file mode 100644 index 67f60a718..000000000 --- a/src/test/correct/functions_with_params/gcc_pic/functions_with_params-before-analysis.il.expected +++ /dev/null @@ -1,338 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000900", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000009b5", condition()) - ) - ) - Block("1752:l000009b5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000009c3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009dc", condition()) - ) - ) - Block("1764:l000009dc", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000009c3", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009cf", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000900", condition()) - ) - ) - Block("1788:l00000900", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1884:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1884:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000bc1", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000082a", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c55", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000840", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a2c", condition()) - ) - ) - Block("1604:l00000840", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a2c", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000885", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000a0e", condition()) - ) - ) - Block("1640:l00000a0e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000885", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a21", condition()) - ) - ) - Block("1660:l00000885", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a21", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1860:plus_one", condition()) - ) - ) - Block("1844:l00000993", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1860:plus_one", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1860:lplus_one", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009f0", condition()) - ) - ) - Block("1700:l000009f0", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000008c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000a03", condition()) - ) - ) - Block("1720:l000008c1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000a03", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/ifbranches/clang/ifbranches-before-analysis.il.expected b/src/test/correct/ifbranches/clang/ifbranches-before-analysis.il.expected deleted file mode 100644 index e2f0a8894..000000000 --- a/src/test/correct/ifbranches/clang/ifbranches-before-analysis.il.expected +++ /dev/null @@ -1,375 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002d9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000003ac", condition()) - ) - ) - Block("1752:l000003ac", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000003ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003d3", condition()) - ) - ) - Block("1764:l000003d3", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000003ba", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000003c6", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002d9", condition()) - ) - ) - Block("1788:l000002d9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1900:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000005bc", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000203", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000677", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000219", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000423", condition()) - ) - ) - Block("1604:l00000219", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000423", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000405", condition()) - ) - ) - Block("1640:l00000405", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000418", condition()) - ) - ) - Block("1660:l0000025e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000418", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l0000034c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l0000034f", condition()) - ) - ) - Block("?:l0000034f", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000352", condition()) - ) - ) - Block("?:l0000034c", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000352", condition()) - ) - ) - Block("?:l00000352", - statements( - ), - jumps( - GoTo("1864:l0000035a", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1848:l00000397", condition()) - ) - ) - Block("1864:l0000035a", - statements( - LocalAssign(Register(R8, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1876:l0000036d", condition()) - ) - ) - Block("1848:l00000397", - statements( - ), - jumps( - GoTo("1852:l00000398", condition()) - ) - ) - Block("1852:l00000398", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1876:l0000036d", condition()) - ) - ) - Block("1876:l0000036d", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000029a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003e7", condition()) - ) - ) - Block("1700:l000003e7", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000029a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003fa", condition()) - ) - ) - Block("1720:l0000029a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003fa", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/ifbranches/clang_O2/ifbranches-before-analysis.il.expected b/src/test/correct/ifbranches/clang_O2/ifbranches-before-analysis.il.expected deleted file mode 100644 index f04cfa835..000000000 --- a/src/test/correct/ifbranches/clang_O2/ifbranches-before-analysis.il.expected +++ /dev/null @@ -1,331 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000291", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002ed", condition()) - ) - ) - Block("1752:l000002ed", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002fb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000314", condition()) - ) - ) - Block("1764:l00000314", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002fb", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000307", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000291", condition()) - ) - ) - Block("1788:l00000291", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1828:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1828:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004eb", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001bb", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000593", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000364", condition()) - ) - ) - Block("1604:l000001d1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000364", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000216", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000346", condition()) - ) - ) - Block("1640:l00000346", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000216", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000359", condition()) - ) - ) - Block("1660:l00000216", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000359", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 2bv64) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("?:l000002db", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l000002df", condition()) - ) - ) - Block("?:l000002df", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - ), - jumps( - GoTo("?:l000002e2", condition()) - ) - ) - Block("?:l000002db", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(Extract(Register(R8, bv64)[32:0]), 32)) - ), - jumps( - GoTo("?:l000002e2", condition()) - ) - ) - Block("?:l000002e2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000328", condition()) - ) - ) - Block("1700:l00000328", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000033b", condition()) - ) - ) - Block("1720:l00000252", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000033b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/ifbranches/clang_no_plt_no_pic/ifbranches-before-analysis.il.expected b/src/test/correct/ifbranches/clang_no_plt_no_pic/ifbranches-before-analysis.il.expected deleted file mode 100644 index 00d66effe..000000000 --- a/src/test/correct/ifbranches/clang_no_plt_no_pic/ifbranches-before-analysis.il.expected +++ /dev/null @@ -1,375 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000945", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000a18", condition()) - ) - ) - Block("1752:l00000a18", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000a26", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000a3f", condition()) - ) - ) - Block("1764:l00000a3f", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000a26", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000a32", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000945", condition()) - ) - ) - Block("1788:l00000945", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1900:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000c28", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000086f", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000cc0", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000885", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a8f", condition()) - ) - ) - Block("1604:l00000885", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a8f", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000008ca", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000a71", condition()) - ) - ) - Block("1640:l00000a71", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l000008ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a84", condition()) - ) - ) - Block("1660:l000008ca", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a84", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l000009b8", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l000009bb", condition()) - ) - ) - Block("?:l000009bb", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l000009be", condition()) - ) - ) - Block("?:l000009b8", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l000009be", condition()) - ) - ) - Block("?:l000009be", - statements( - ), - jumps( - GoTo("1864:l000009c6", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1848:l00000a03", condition()) - ) - ) - Block("1864:l000009c6", - statements( - LocalAssign(Register(R8, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1876:l000009d9", condition()) - ) - ) - Block("1848:l00000a03", - statements( - ), - jumps( - GoTo("1852:l00000a04", condition()) - ) - ) - Block("1852:l00000a04", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1876:l000009d9", condition()) - ) - ) - Block("1876:l000009d9", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000906", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000a53", condition()) - ) - ) - Block("1700:l00000a53", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000906", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000a66", condition()) - ) - ) - Block("1720:l00000906", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000a66", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/ifbranches/clang_pic/ifbranches-before-analysis.il.expected b/src/test/correct/ifbranches/clang_pic/ifbranches-before-analysis.il.expected deleted file mode 100644 index 00d66effe..000000000 --- a/src/test/correct/ifbranches/clang_pic/ifbranches-before-analysis.il.expected +++ /dev/null @@ -1,375 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000945", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000a18", condition()) - ) - ) - Block("1752:l00000a18", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000a26", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000a3f", condition()) - ) - ) - Block("1764:l00000a3f", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000a26", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000a32", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000945", condition()) - ) - ) - Block("1788:l00000945", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1900:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000c28", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000086f", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000cc0", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000885", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a8f", condition()) - ) - ) - Block("1604:l00000885", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a8f", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000008ca", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000a71", condition()) - ) - ) - Block("1640:l00000a71", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l000008ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a84", condition()) - ) - ) - Block("1660:l000008ca", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a84", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l000009b8", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l000009bb", condition()) - ) - ) - Block("?:l000009bb", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l000009be", condition()) - ) - ) - Block("?:l000009b8", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l000009be", condition()) - ) - ) - Block("?:l000009be", - statements( - ), - jumps( - GoTo("1864:l000009c6", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1848:l00000a03", condition()) - ) - ) - Block("1864:l000009c6", - statements( - LocalAssign(Register(R8, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1876:l000009d9", condition()) - ) - ) - Block("1848:l00000a03", - statements( - ), - jumps( - GoTo("1852:l00000a04", condition()) - ) - ) - Block("1852:l00000a04", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1876:l000009d9", condition()) - ) - ) - Block("1876:l000009d9", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000906", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000a53", condition()) - ) - ) - Block("1700:l00000a53", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000906", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000a66", condition()) - ) - ) - Block("1720:l00000906", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000a66", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/ifbranches/gcc/ifbranches-before-analysis.il.expected b/src/test/correct/ifbranches/gcc/ifbranches-before-analysis.il.expected deleted file mode 100644 index f575f8a04..000000000 --- a/src/test/correct/ifbranches/gcc/ifbranches-before-analysis.il.expected +++ /dev/null @@ -1,342 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002c9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000037a", condition()) - ) - ) - Block("1752:l0000037a", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000388", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003a1", condition()) - ) - ) - Block("1764:l000003a1", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000388", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000394", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002c9", condition()) - ) - ) - Block("1788:l000002c9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1884:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1884:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000586", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001f3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000063e", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000209", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003f1", condition()) - ) - ) - Block("1604:l00000209", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003f1", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003d3", condition()) - ) - ) - Block("1640:l000003d3", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003e6", condition()) - ) - ) - Block("1660:l0000024e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003e6", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R1, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1852:l00000330", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1840:l00000369", condition()) - ) - ) - Block("1852:l00000330", - statements( - LocalAssign(Register(R0, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1860:l00000342", condition()) - ) - ) - Block("1840:l00000369", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1860:l00000342", condition()) - ) - ) - Block("1860:l00000342", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003b5", condition()) - ) - ) - Block("1700:l000003b5", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003c8", condition()) - ) - ) - Block("1720:l0000028a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003c8", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/ifbranches/gcc_O2/ifbranches-before-analysis.il.expected b/src/test/correct/ifbranches/gcc_O2/ifbranches-before-analysis.il.expected deleted file mode 100644 index 6b815666b..000000000 --- a/src/test/correct/ifbranches/gcc_O2/ifbranches-before-analysis.il.expected +++ /dev/null @@ -1,331 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l0000030b", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000334", condition()) - ) - ) - Block("1816:l00000334", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l00000342", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000035b", condition()) - ) - ) - Block("1828:l0000035b", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000342", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000034e", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l0000030b", condition()) - ) - ) - Block("1852:l0000030b", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l0000053e", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000235", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005f2", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l0000024b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003ab", condition()) - ) - ) - Block("1668:l0000024b", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003ab", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000290", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000038d", condition()) - ) - ) - Block("1704:l0000038d", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000290", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003a0", condition()) - ) - ) - Block("1724:l00000290", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003a0", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(LocalVar(#1, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#1, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#1, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#1, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#1, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("?:l000001c3", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l000001c6", condition()) - ) - ) - Block("?:l000001c6", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - ), - jumps( - GoTo("?:l000001c9", condition()) - ) - ) - Block("?:l000001c3", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - GoTo("?:l000001c9", condition()) - ) - ) - Block("?:l000001c9", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 2bv32), 32)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002cc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000036f", condition()) - ) - ) - Block("1764:l0000036f", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002cc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000382", condition()) - ) - ) - Block("1784:l000002cc", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000382", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/ifbranches/gcc_no_plt_no_pic/ifbranches-before-analysis.il.expected b/src/test/correct/ifbranches/gcc_no_plt_no_pic/ifbranches-before-analysis.il.expected deleted file mode 100644 index ac9ccda29..000000000 --- a/src/test/correct/ifbranches/gcc_no_plt_no_pic/ifbranches-before-analysis.il.expected +++ /dev/null @@ -1,342 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008fc", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000009ad", condition()) - ) - ) - Block("1752:l000009ad", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000009bb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009d4", condition()) - ) - ) - Block("1764:l000009d4", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000009bb", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009c7", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008fc", condition()) - ) - ) - Block("1788:l000008fc", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1884:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1884:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000bb9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000826", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c4d", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l0000083c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a24", condition()) - ) - ) - Block("1604:l0000083c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a24", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000881", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000a06", condition()) - ) - ) - Block("1640:l00000a06", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000881", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a19", condition()) - ) - ) - Block("1660:l00000881", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a19", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R1, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1852:l00000963", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1840:l0000099c", condition()) - ) - ) - Block("1852:l00000963", - statements( - LocalAssign(Register(R0, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1860:l00000975", condition()) - ) - ) - Block("1840:l0000099c", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1860:l00000975", condition()) - ) - ) - Block("1860:l00000975", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009e8", condition()) - ) - ) - Block("1700:l000009e8", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000008bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009fb", condition()) - ) - ) - Block("1720:l000008bd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009fb", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/ifbranches/gcc_pic/ifbranches-before-analysis.il.expected b/src/test/correct/ifbranches/gcc_pic/ifbranches-before-analysis.il.expected deleted file mode 100644 index ac9ccda29..000000000 --- a/src/test/correct/ifbranches/gcc_pic/ifbranches-before-analysis.il.expected +++ /dev/null @@ -1,342 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008fc", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000009ad", condition()) - ) - ) - Block("1752:l000009ad", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000009bb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009d4", condition()) - ) - ) - Block("1764:l000009d4", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000009bb", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009c7", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008fc", condition()) - ) - ) - Block("1788:l000008fc", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1884:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1884:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000bb9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000826", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c4d", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l0000083c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a24", condition()) - ) - ) - Block("1604:l0000083c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a24", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000881", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000a06", condition()) - ) - ) - Block("1640:l00000a06", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000881", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a19", condition()) - ) - ) - Block("1660:l00000881", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a19", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R1, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1852:l00000963", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1840:l0000099c", condition()) - ) - ) - Block("1852:l00000963", - statements( - LocalAssign(Register(R0, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1860:l00000975", condition()) - ) - ) - Block("1840:l0000099c", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1860:l00000975", condition()) - ) - ) - Block("1860:l00000975", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009e8", condition()) - ) - ) - Block("1700:l000009e8", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000008bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009fb", condition()) - ) - ) - Block("1720:l000008bd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009fb", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/ifglobal/clang/ifglobal-before-analysis.il.expected b/src/test/correct/ifglobal/clang/ifglobal-before-analysis.il.expected deleted file mode 100644 index 4039fb15c..000000000 --- a/src/test/correct/ifglobal/clang/ifglobal-before-analysis.il.expected +++ /dev/null @@ -1,362 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000035d", condition()) - ) - ) - Block("1752:l0000035d", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000036b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000384", condition()) - ) - ) - Block("1764:l00000384", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000036b", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000377", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002bd", condition()) - ) - ) - Block("1788:l000002bd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000566", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001e7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000061a", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003d4", condition()) - ) - ) - Block("1604:l000001fd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003d4", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003b6", condition()) - ) - ) - Block("1640:l000003b6", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003c9", condition()) - ) - ) - Block("1660:l00000242", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003c9", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l0000031e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000321", condition()) - ) - ) - Block("?:l00000321", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000324", condition()) - ) - ) - Block("?:l0000031e", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000324", condition()) - ) - ) - Block("?:l00000324", - statements( - ), - jumps( - GoTo("1860:l0000032c", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1840:l00000343", condition()) - ) - ) - Block("1840:l00000343", - statements( - ), - jumps( - GoTo("1844:l00000344", condition()) - ) - ) - Block("1844:l00000344", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - LocalAssign(Register(R9, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1860:l0000032c", condition()) - ) - ) - Block("1860:l0000032c", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000398", condition()) - ) - ) - Block("1700:l00000398", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003ab", condition()) - ) - ) - Block("1720:l0000027e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003ab", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/ifglobal/clang_O2/ifglobal-before-analysis.il.expected b/src/test/correct/ifglobal/clang_O2/ifglobal-before-analysis.il.expected deleted file mode 100644 index 5c9edb780..000000000 --- a/src/test/correct/ifglobal/clang_O2/ifglobal-before-analysis.il.expected +++ /dev/null @@ -1,322 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000302", condition()) - ) - ) - Block("1752:l00000302", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000310", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000329", condition()) - ) - ) - Block("1764:l00000329", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000310", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000031c", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002a5", condition()) - ) - ) - Block("1788:l000002a5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1848:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000505", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001cf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005b3", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000379", condition()) - ) - ) - Block("1604:l000001e5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000379", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000035b", condition()) - ) - ) - Block("1640:l0000035b", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000036e", condition()) - ) - ) - Block("1660:l0000022a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000036e", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - ), - jumps( - GoTo("1832:l000002dc", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R9, bv64)[32:0]), 0bv32), 0bv1))) - GoTo("1824:l000002f8", condition()) - ) - ) - Block("1832:l000002dc", - statements( - LocalAssign(Register(R9, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1824:l000002f8", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000033d", condition()) - ) - ) - Block("1700:l0000033d", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000350", condition()) - ) - ) - Block("1720:l00000266", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000350", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/ifglobal/clang_no_plt_no_pic/ifglobal-before-analysis.il.expected b/src/test/correct/ifglobal/clang_no_plt_no_pic/ifglobal-before-analysis.il.expected deleted file mode 100644 index 46c9031d0..000000000 --- a/src/test/correct/ifglobal/clang_no_plt_no_pic/ifglobal-before-analysis.il.expected +++ /dev/null @@ -1,362 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008cc", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000096c", condition()) - ) - ) - Block("1752:l0000096c", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000097a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000993", condition()) - ) - ) - Block("1764:l00000993", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000097a", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000986", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008cc", condition()) - ) - ) - Block("1788:l000008cc", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b75", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007f6", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c06", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000080c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000009e3", condition()) - ) - ) - Block("1604:l0000080c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000009e3", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000851", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009c5", condition()) - ) - ) - Block("1640:l000009c5", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000851", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009d8", condition()) - ) - ) - Block("1660:l00000851", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009d8", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l0000092d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000930", condition()) - ) - ) - Block("?:l00000930", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000933", condition()) - ) - ) - Block("?:l0000092d", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000933", condition()) - ) - ) - Block("?:l00000933", - statements( - ), - jumps( - GoTo("1860:l0000093b", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1840:l00000952", condition()) - ) - ) - Block("1840:l00000952", - statements( - ), - jumps( - GoTo("1844:l00000953", condition()) - ) - ) - Block("1844:l00000953", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - LocalAssign(Register(R9, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1860:l0000093b", condition()) - ) - ) - Block("1860:l0000093b", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000088d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009a7", condition()) - ) - ) - Block("1700:l000009a7", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000088d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009ba", condition()) - ) - ) - Block("1720:l0000088d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009ba", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/ifglobal/clang_pic/ifglobal-before-analysis.il.expected b/src/test/correct/ifglobal/clang_pic/ifglobal-before-analysis.il.expected deleted file mode 100644 index 0e64742de..000000000 --- a/src/test/correct/ifglobal/clang_pic/ifglobal-before-analysis.il.expected +++ /dev/null @@ -1,364 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000373", condition()) - ) - ) - Block("1816:l00000373", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) - ), - jumps( - GoTo("1840:l00000381", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000039a", condition()) - ) - ) - Block("1828:l0000039a", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000381", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000038d", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002c5", condition()) - ) - ) - Block("1852:l000002c5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1944:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l00000521", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001ef", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l000005d7", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003ea", condition()) - ) - ) - Block("1668:l00000205", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003ea", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003cc", condition()) - ) - ) - Block("1704:l000003cc", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003df", condition()) - ) - ) - Block("1724:l0000024a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003df", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4040bv64)])) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l0000032d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000330", condition()) - ) - ) - Block("?:l00000330", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000333", condition()) - ) - ) - Block("?:l0000032d", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000333", condition()) - ) - ) - Block("?:l00000333", - statements( - ), - jumps( - GoTo("1932:l0000033b", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1908:l00000352", condition()) - ) - ) - Block("1908:l00000352", - statements( - ), - jumps( - GoTo("1912:l00000353", condition()) - ) - ) - Block("1912:l00000353", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4040bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1932:l0000033b", condition()) - ) - ) - Block("1932:l0000033b", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003ae", condition()) - ) - ) - Block("1764:l000003ae", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003c1", condition()) - ) - ) - Block("1784:l00000286", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003c1", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/ifglobal/gcc/ifglobal-before-analysis.il.expected b/src/test/correct/ifglobal/gcc/ifglobal-before-analysis.il.expected deleted file mode 100644 index bd34f224b..000000000 --- a/src/test/correct/ifglobal/gcc/ifglobal-before-analysis.il.expected +++ /dev/null @@ -1,329 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002ad", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000329", condition()) - ) - ) - Block("1752:l00000329", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000337", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000350", condition()) - ) - ) - Block("1764:l00000350", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000337", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000343", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002ad", condition()) - ) - ) - Block("1788:l000002ad", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1856:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l0000052e", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001d7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005df", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000001ed", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003a0", condition()) - ) - ) - Block("1604:l000001ed", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003a0", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000232", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000382", condition()) - ) - ) - Block("1640:l00000382", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000232", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000395", condition()) - ) - ) - Block("1660:l00000232", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000395", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1848:l00000302", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1832:l00000311", condition()) - ) - ) - Block("1832:l00000311", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - GoTo("1848:l00000302", condition()) - ) - ) - Block("1848:l00000302", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000026e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000364", condition()) - ) - ) - Block("1700:l00000364", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000026e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000377", condition()) - ) - ) - Block("1720:l0000026e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000377", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/ifglobal/gcc_O2/ifglobal-before-analysis.il.expected b/src/test/correct/ifglobal/gcc_O2/ifglobal-before-analysis.il.expected deleted file mode 100644 index 65402983e..000000000 --- a/src/test/correct/ifglobal/gcc_O2/ifglobal-before-analysis.il.expected +++ /dev/null @@ -1,321 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000031a", condition()) - ) - ) - Block("1816:l0000031a", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l00000328", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000341", condition()) - ) - ) - Block("1828:l00000341", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000328", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000334", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f1", condition()) - ) - ) - Block("1852:l000002f1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l00000531", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l0000021b", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005e7", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000231", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000391", condition()) - ) - ) - Block("1668:l00000231", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000391", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000373", condition()) - ) - ) - Block("1704:l00000373", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000386", condition()) - ) - ) - Block("1724:l00000276", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000386", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 20bv64)]), 32)) - ), - jumps( - GoTo("1556:l000001b7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R1, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1548:l00000396", condition()) - ) - ) - Block("1548:l00000396", - statements( - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R0, bv64), 20bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - GoTo("1556:l000001b7", condition()) - ) - ) - Block("1556:l000001b7", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002b2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000355", condition()) - ) - ) - Block("1764:l00000355", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002b2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000368", condition()) - ) - ) - Block("1784:l000002b2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000368", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/ifglobal/gcc_no_plt_no_pic/ifglobal-before-analysis.il.expected b/src/test/correct/ifglobal/gcc_no_plt_no_pic/ifglobal-before-analysis.il.expected deleted file mode 100644 index d10b07697..000000000 --- a/src/test/correct/ifglobal/gcc_no_plt_no_pic/ifglobal-before-analysis.il.expected +++ /dev/null @@ -1,329 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000881", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000008fd", condition()) - ) - ) - Block("1752:l000008fd", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l0000090b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000924", condition()) - ) - ) - Block("1764:l00000924", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000090b", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000917", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000881", condition()) - ) - ) - Block("1788:l00000881", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1856:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b02", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007ab", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000b8f", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000007c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000974", condition()) - ) - ) - Block("1604:l000007c1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000974", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000806", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000956", condition()) - ) - ) - Block("1640:l00000956", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000806", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000969", condition()) - ) - ) - Block("1660:l00000806", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000969", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1848:l000008d6", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1832:l000008e5", condition()) - ) - ) - Block("1832:l000008e5", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - GoTo("1848:l000008d6", condition()) - ) - ) - Block("1848:l000008d6", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000842", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000938", condition()) - ) - ) - Block("1700:l00000938", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000842", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000094b", condition()) - ) - ) - Block("1720:l00000842", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000094b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/ifglobal/gcc_pic/ifglobal-before-analysis.il.expected b/src/test/correct/ifglobal/gcc_pic/ifglobal-before-analysis.il.expected deleted file mode 100644 index d4ea5a415..000000000 --- a/src/test/correct/ifglobal/gcc_pic/ifglobal-before-analysis.il.expected +++ /dev/null @@ -1,329 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002ad", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000032b", condition()) - ) - ) - Block("1816:l0000032b", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - ), - jumps( - GoTo("1840:l00000339", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000352", condition()) - ) - ) - Block("1828:l00000352", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000339", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000345", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002ad", condition()) - ) - ) - Block("1852:l000002ad", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1920:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l000004d9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001d7", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l0000058a", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l000001ed", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003a2", condition()) - ) - ) - Block("1668:l000001ed", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003a2", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000232", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000384", condition()) - ) - ) - Block("1704:l00000384", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) - ), - jumps( - GoTo("1724:l00000232", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000397", condition()) - ) - ) - Block("1724:l00000232", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000397", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1912:l00000303", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1896:l00000312", condition()) - ) - ) - Block("1896:l00000312", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - GoTo("1912:l00000303", condition()) - ) - ) - Block("1912:l00000303", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000026e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000366", condition()) - ) - ) - Block("1764:l00000366", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l0000026e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000379", condition()) - ) - ) - Block("1784:l0000026e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000379", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/indirect_call/clang_O2/indirect_call-before-analysis.il.expected b/src/test/correct/indirect_call/clang_O2/indirect_call-before-analysis.il.expected deleted file mode 100644 index 23a148a79..000000000 --- a/src/test/correct/indirect_call/clang_O2/indirect_call-before-analysis.il.expected +++ /dev/null @@ -1,343 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002b9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000034c", condition()) - ) - ) - Block("1816:l0000034c", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1840:l0000035a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000373", condition()) - ) - ) - Block("1828:l00000373", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000035a", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000366", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002b9", condition()) - ) - ) - Block("1852:l000002b9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1932:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1932:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1464:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1480bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1480:l0000057a", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001e3", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l00000635", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l000001f9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003c3", condition()) - ) - ) - Block("1668:l000001f9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003c3", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003a5", condition()) - ) - ) - Block("1704:l000003a5", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1724:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003b8", condition()) - ) - ) - Block("1724:l0000023e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003b8", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:greet", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:lgreet", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1956bv64)) - ), - jumps( - DirectCall("1584:puts", condition()) - ) - ) -)), -Procedure("1888:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1888:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1970bv64)) - LocalAssign(Register(R30, bv64) := 1908bv64) - ), - jumps( - DirectCall("1584:puts", condition()) - ) - ) - Block("1908:l00000320", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1956bv64)) - LocalAssign(Register(R30, bv64) := 1920bv64) - ), - jumps( - DirectCall("1584:puts", condition()) - ) - ) - Block("1920:l00000332", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1584:puts", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000387", condition()) - ) - ) - Block("1764:l00000387", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000039a", condition()) - ) - ) - Block("1784:l0000027a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000039a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/indirect_call/gcc_O2/indirect_call-before-analysis.il.expected b/src/test/correct/indirect_call/gcc_O2/indirect_call-before-analysis.il.expected deleted file mode 100644 index 21702696f..000000000 --- a/src/test/correct/indirect_call/gcc_O2/indirect_call-before-analysis.il.expected +++ /dev/null @@ -1,341 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1856:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1916:l00000346", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1880:l00000375", condition()) - ) - ) - Block("1880:l00000375", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1904:l00000383", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1892:l0000039c", condition()) - ) - ) - Block("1892:l0000039c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1904bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1904:l00000383", - statements( - LocalAssign(Register(R30, bv64) := 1908bv64) - ), - jumps( - DirectCall("1744:deregister_tm_clones", condition()) - ) - ) - Block("1908:l0000038f", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1916:l00000346", condition()) - ) - ) - Block("1916:l00000346", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1964:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1964:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1464:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1480bv64) - ), - jumps( - DirectCall("1716:call_weak_fn", condition()) - ) - ) - Block("1480:l000005ab", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1712bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1712:l00000270", - statements( - LocalAssign(Register(R30, bv64) := 1716bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l0000066e", - statements( - ), - jumps( - DirectCall("1716:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1716:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1716:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1732:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1728:l000003ec", condition()) - ) - ) - Block("1732:l00000286", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1728:l000003ec", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1744:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1744:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1788:l000002cb", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1768:l000003ce", condition()) - ) - ) - Block("1768:l000003ce", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1788:l000002cb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1780:l000003e1", condition()) - ) - ) - Block("1788:l000002cb", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1780:l000003e1", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1936:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1936:lframe_dummy", - statements( - ), - jumps( - DirectCall("1792:register_tm_clones", condition()) - ) - ) -)), -Procedure("1952:greet", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1952:lgreet", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1992bv64)) - ), - jumps( - DirectCall("1584:puts", condition()) - ) - ) -)), -Procedure("1600:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1600:lmain", - statements( - LocalAssign(LocalVar(#1, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#1, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#1, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#1, bv64)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2008bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1620bv64) - ), - jumps( - DirectCall("1584:puts", condition()) - ) - ) - Block("1620:l000001ef", - statements( - LocalAssign(Register(R30, bv64) := 1624bv64) - ), - jumps( - DirectCall("1952:greet", condition()) - ) - ) - Block("1624:l00000205", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1584:puts", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1848:l00000307", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1828:l000003b0", condition()) - ) - ) - Block("1828:l000003b0", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1848:l00000307", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1840:l000003c3", condition()) - ) - ) - Block("1848:l00000307", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1840:l000003c3", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/initialisation/clang/initialisation-before-analysis.il.expected b/src/test/correct/initialisation/clang/initialisation-before-analysis.il.expected deleted file mode 100644 index a5fe752a6..000000000 --- a/src/test/correct/initialisation/clang/initialisation-before-analysis.il.expected +++ /dev/null @@ -1,325 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002d1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000038d", condition()) - ) - ) - Block("1752:l0000038d", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000039b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003b4", condition()) - ) - ) - Block("1764:l000003b4", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000039b", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000003a7", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002d1", condition()) - ) - ) - Block("1788:l000002d1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1892:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1892:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l0000059b", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001fb", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000653", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000211", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000404", condition()) - ) - ) - Block("1604:l00000211", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000404", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003e6", condition()) - ) - ) - Block("1640:l000003e6", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003f9", condition()) - ) - ) - Block("1660:l00000256", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003f9", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := BinaryExpr("add", Register(R9, bv64), 64bv64)) - LocalAssign(Register(R11, bv64) := 69632bv64) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R11, bv64), 48bv64)]), 32)) - LocalAssign(Register(R10, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R10, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R11, bv64), 48bv64)] := Extract(Register(R10, bv64)[32:0]))) - LocalAssign(Register(R11, bv64) := 69632bv64) - LocalAssign(Register(R10, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R11, bv64), 56bv64)])) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R10, bv64), 18446744073709551614bv64)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv64), 1bv64), 1), BinaryExpr("add", SignExtend(Register(R10, bv64), 1), 36893488147419103231bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv64), 1bv64), 1), BinaryExpr("add", ZeroExtend(Register(R10, bv64), 1), 18446744073709551615bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv64), 1bv64)[64:63])) - LocalAssign(Register(R10, bv64) := BinaryExpr("add", LocalVar(#4, bv64), 1bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R11, bv64), 56bv64)] := Register(R10, bv64))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 64bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 3bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 56)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003c8", condition()) - ) - ) - Block("1700:l000003c8", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000292", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003db", condition()) - ) - ) - Block("1720:l00000292", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003db", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/initialisation/clang_O2/initialisation-before-analysis.il.expected b/src/test/correct/initialisation/clang_O2/initialisation-before-analysis.il.expected deleted file mode 100644 index 820595de8..000000000 --- a/src/test/correct/initialisation/clang_O2/initialisation-before-analysis.il.expected +++ /dev/null @@ -1,319 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002cd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000036e", condition()) - ) - ) - Block("1752:l0000036e", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000037c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000395", condition()) - ) - ) - Block("1764:l00000395", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000037c", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000388", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002cd", condition()) - ) - ) - Block("1788:l000002cd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1888:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1888:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l0000057b", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001f7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000632", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000020d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003e5", condition()) - ) - ) - Block("1604:l0000020d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003e5", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003c7", condition()) - ) - ) - Block("1640:l000003c7", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000252", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003da", condition()) - ) - ) - Block("1660:l00000252", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003da", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R10, bv64) := 69632bv64) - LocalAssign(Register(R10, bv64) := BinaryExpr("add", Register(R10, bv64), 64bv64)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R12, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R11, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R10, bv64)]), 32)) - LocalAssign(Register(R13, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 48bv64)]), 32)) - LocalAssign(Register(R14, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 56bv64)])) - LocalAssign(Register(R11, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R11, bv64)[32:0]), 3bv32), 32)) - LocalAssign(Register(R15, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R12, bv64), 52bv64)]), 56)) - LocalAssign(Register(R13, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R13, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R14, bv64) := BinaryExpr("add", Register(R14, bv64), 18446744073709551615bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R10, bv64), 4bv64)] := Extract(Register(R11, bv64)[32:0]))) - LocalAssign(Register(R10, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R15, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 48bv64)] := Extract(Register(R13, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Register(R14, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R12, bv64), 52bv64)] := Extract(Register(R10, bv64)[8:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003a9", condition()) - ) - ) - Block("1700:l000003a9", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003bc", condition()) - ) - ) - Block("1720:l0000028e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003bc", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/initialisation/clang_no_plt_no_pic/initialisation-before-analysis.il.expected b/src/test/correct/initialisation/clang_no_plt_no_pic/initialisation-before-analysis.il.expected deleted file mode 100644 index 270922294..000000000 --- a/src/test/correct/initialisation/clang_no_plt_no_pic/initialisation-before-analysis.il.expected +++ /dev/null @@ -1,325 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000919", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000009d5", condition()) - ) - ) - Block("1752:l000009d5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000009e3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009fc", condition()) - ) - ) - Block("1764:l000009fc", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000009e3", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009ef", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000919", condition()) - ) - ) - Block("1788:l00000919", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1892:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1892:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000be3", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000843", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c79", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000859", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a4c", condition()) - ) - ) - Block("1604:l00000859", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a4c", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000089e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000a2e", condition()) - ) - ) - Block("1640:l00000a2e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000089e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a41", condition()) - ) - ) - Block("1660:l0000089e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a41", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := BinaryExpr("add", Register(R9, bv64), 64bv64)) - LocalAssign(Register(R11, bv64) := 69632bv64) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R11, bv64), 48bv64)]), 32)) - LocalAssign(Register(R10, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R10, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R11, bv64), 48bv64)] := Extract(Register(R10, bv64)[32:0]))) - LocalAssign(Register(R11, bv64) := 69632bv64) - LocalAssign(Register(R10, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R11, bv64), 56bv64)])) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R10, bv64), 18446744073709551614bv64)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv64), 1bv64), 1), BinaryExpr("add", SignExtend(Register(R10, bv64), 1), 36893488147419103231bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv64), 1bv64), 1), BinaryExpr("add", ZeroExtend(Register(R10, bv64), 1), 18446744073709551615bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv64), 1bv64)[64:63])) - LocalAssign(Register(R10, bv64) := BinaryExpr("add", LocalVar(#4, bv64), 1bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R11, bv64), 56bv64)] := Register(R10, bv64))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 64bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 3bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 56)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008da", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000a10", condition()) - ) - ) - Block("1700:l00000a10", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000008da", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000a23", condition()) - ) - ) - Block("1720:l000008da", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000a23", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/initialisation/clang_pic/initialisation-before-analysis.il.expected b/src/test/correct/initialisation/clang_pic/initialisation-before-analysis.il.expected deleted file mode 100644 index 492481689..000000000 --- a/src/test/correct/initialisation/clang_pic/initialisation-before-analysis.il.expected +++ /dev/null @@ -1,327 +0,0 @@ -Procedure("1584:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1856:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) - ), - jumps( - GoTo("1916:l000002d9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1880:l000003a6", condition()) - ) - ) - Block("1880:l000003a6", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4008bv64)])) - ), - jumps( - GoTo("1904:l000003b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1892:l000003cd", condition()) - ) - ) - Block("1892:l000003cd", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1904bv64) - ), - jumps( - DirectCall("1584:__cxa_finalize", condition()) - ) - ) - Block("1904:l000003b4", - statements( - LocalAssign(Register(R30, bv64) := 1908bv64) - ), - jumps( - DirectCall("1744:deregister_tm_clones", condition()) - ) - ) - Block("1908:l000003c0", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1916:l000002d9", condition()) - ) - ) - Block("1916:l000002d9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1568:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1568:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2028:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2028:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1504:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1504:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1520bv64) - ), - jumps( - DirectCall("1716:call_weak_fn", condition()) - ) - ) - Block("1520:l00000554", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1712bv64) - ), - jumps( - DirectCall("1568:__libc_start_main", condition()) - ) - ) - Block("1712:l00000203", - statements( - LocalAssign(Register(R30, bv64) := 1716bv64) - ), - jumps( - DirectCall("1616:abort", condition()) - ) - ) - Block("?:l000005f5", - statements( - ), - jumps( - DirectCall("1716:call_weak_fn", condition()) - ) - ) -)), -Procedure("1616:abort", in(), out(), blocks( -)), -Procedure("1716:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1716:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) - ), - jumps( - GoTo("1732:l00000219", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1728:l0000041d", condition()) - ) - ) - Block("1732:l00000219", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1728:l0000041d", - statements( - ), - jumps( - GoTo("1600:l__gmon_start__", condition()) - ) - ) - Block("1600:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1744:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1744:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1788:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1768:l000003ff", condition()) - ) - ) - Block("1768:l000003ff", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4000bv64)])) - ), - jumps( - GoTo("1788:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1780:l00000412", condition()) - ) - ) - Block("1788:l0000025e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1780:l00000412", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1936:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1936:lframe_dummy", - statements( - ), - jumps( - DirectCall("1792:register_tm_clones", condition()) - ) - ) -)), -Procedure("1940:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1940:lmain", - statements( - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4040bv64)])) - LocalAssign(Register(R10, bv64) := 65536bv64) - LocalAssign(Register(R10, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R10, bv64), 4024bv64)])) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R10, bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R10, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R10, bv64) := 65536bv64) - LocalAssign(Register(R10, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R10, bv64), 4016bv64)])) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R10, bv64)])) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R8, bv64), 18446744073709551614bv64)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv64), 1bv64), 1), BinaryExpr("add", SignExtend(Register(R8, bv64), 1), 36893488147419103231bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv64), 1bv64), 1), BinaryExpr("add", ZeroExtend(Register(R8, bv64), 1), 18446744073709551615bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv64), 1bv64)[64:63])) - LocalAssign(Register(R8, bv64) := BinaryExpr("add", LocalVar(#4, bv64), 1bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R10, bv64)] := Register(R8, bv64))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R9, bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 3bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4048bv64)])) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R9, bv64)]), 56)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1848:l0000029a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1828:l000003e1", condition()) - ) - ) - Block("1828:l000003e1", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1848:l0000029a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1840:l000003f4", condition()) - ) - ) - Block("1848:l0000029a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1840:l000003f4", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/initialisation/gcc/initialisation-before-analysis.il.expected b/src/test/correct/initialisation/gcc/initialisation-before-analysis.il.expected deleted file mode 100644 index 7fb87edec..000000000 --- a/src/test/correct/initialisation/gcc/initialisation-before-analysis.il.expected +++ /dev/null @@ -1,331 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 40bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002fd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000003e2", condition()) - ) - ) - Block("1752:l000003e2", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000003f0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000409", condition()) - ) - ) - Block("1764:l00000409", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000003f0", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000003fc", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 40bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002fd", condition()) - ) - ) - Block("1788:l000002fd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1936:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1936:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000005fb", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000227", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000006be", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l0000023d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000459", condition()) - ) - ) - Block("1604:l0000023d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000459", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 40bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 40bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000043b", condition()) - ) - ) - Block("1640:l0000043b", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000044e", condition()) - ) - ) - Block("1660:l00000282", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000044e", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)])) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R0, bv64), 18446744073709551615bv64)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Register(R1, bv64))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 32bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 3bv32), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 32bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R0, bv64), 4bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("++", 0bv24, Extract(Register(R0, bv64)[8:0])), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 40bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 40bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000041d", condition()) - ) - ) - Block("1700:l0000041d", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000430", condition()) - ) - ) - Block("1720:l000002be", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000430", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/initialisation/gcc_O2/initialisation-before-analysis.il.expected b/src/test/correct/initialisation/gcc_O2/initialisation-before-analysis.il.expected deleted file mode 100644 index b3a347b76..000000000 --- a/src/test/correct/initialisation/gcc_O2/initialisation-before-analysis.il.expected +++ /dev/null @@ -1,316 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 41bv64)]), 56)) - ), - jumps( - GoTo("1852:l0000032a", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000353", condition()) - ) - ) - Block("1816:l00000353", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l00000361", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000037a", condition()) - ) - ) - Block("1828:l0000037a", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000361", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000036d", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 41bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l0000032a", condition()) - ) - ) - Block("1852:l0000032a", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l0000055d", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000254", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000611", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l0000026a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003ca", condition()) - ) - ) - Block("1668:l0000026a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003ca", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l000002af", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003ac", condition()) - ) - ) - Block("1704:l000003ac", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l000002af", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003bf", condition()) - ) - ) - Block("1724:l000002af", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003bf", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R5, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R5, bv64), 16bv64)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R6, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R5, bv64), 16bv64)]), 32)) - LocalAssign(Register(R4, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 8bv64)])) - LocalAssign(Register(R6, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R6, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R2, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 24bv64)]), 56)) - LocalAssign(Register(R3, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) - LocalAssign(Register(R4, bv64) := BinaryExpr("add", Register(R4, bv64), 18446744073709551615bv64)) - LocalAssign(Register(R2, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R2, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R5, bv64), 16bv64)] := Extract(Register(R6, bv64)[32:0]))) - LocalAssign(Register(R3, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R3, bv64)[32:0]), 3bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 8bv64)] := Register(R4, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R3, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 24bv64)] := Extract(Register(R2, bv64)[8:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002eb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000038e", condition()) - ) - ) - Block("1764:l0000038e", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002eb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003a1", condition()) - ) - ) - Block("1784:l000002eb", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003a1", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/initialisation/gcc_no_plt_no_pic/initialisation-before-analysis.il.expected b/src/test/correct/initialisation/gcc_no_plt_no_pic/initialisation-before-analysis.il.expected deleted file mode 100644 index 93fce3cf7..000000000 --- a/src/test/correct/initialisation/gcc_no_plt_no_pic/initialisation-before-analysis.il.expected +++ /dev/null @@ -1,331 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 40bv64)]), 56)) - ), - jumps( - GoTo("1788:l000009b0", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000a95", condition()) - ) - ) - Block("1752:l00000a95", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000aa3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000abc", condition()) - ) - ) - Block("1764:l00000abc", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000aa3", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000aaf", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 40bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000009b0", condition()) - ) - ) - Block("1788:l000009b0", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1936:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1936:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000cae", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000008da", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000d4f", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000008f0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000b0c", condition()) - ) - ) - Block("1604:l000008f0", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000b0c", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 40bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 40bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000935", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000aee", condition()) - ) - ) - Block("1640:l00000aee", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000935", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000b01", condition()) - ) - ) - Block("1660:l00000935", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000b01", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)])) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R0, bv64), 18446744073709551615bv64)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Register(R1, bv64))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 32bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 3bv32), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 32bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R0, bv64), 4bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("++", 0bv24, Extract(Register(R0, bv64)[8:0])), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 40bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 40bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000971", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000ad0", condition()) - ) - ) - Block("1700:l00000ad0", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000971", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000ae3", condition()) - ) - ) - Block("1720:l00000971", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000ae3", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/initialisation/gcc_pic/initialisation-before-analysis.il.expected b/src/test/correct/initialisation/gcc_pic/initialisation-before-analysis.il.expected deleted file mode 100644 index 9cac1b6ca..000000000 --- a/src/test/correct/initialisation/gcc_pic/initialisation-before-analysis.il.expected +++ /dev/null @@ -1,331 +0,0 @@ -Procedure("1584:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1856:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 40bv64)]), 56)) - ), - jumps( - GoTo("1916:l000002fd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1880:l000003ea", condition()) - ) - ) - Block("1880:l000003ea", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) - ), - jumps( - GoTo("1904:l000003f8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1892:l00000411", condition()) - ) - ) - Block("1892:l00000411", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1904bv64) - ), - jumps( - DirectCall("1584:__cxa_finalize", condition()) - ) - ) - Block("1904:l000003f8", - statements( - LocalAssign(Register(R30, bv64) := 1908bv64) - ), - jumps( - DirectCall("1744:deregister_tm_clones", condition()) - ) - ) - Block("1908:l00000404", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 40bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1916:l000002fd", condition()) - ) - ) - Block("1916:l000002fd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1568:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1568:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3984bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3984bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2064:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1504:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1504:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1520bv64) - ), - jumps( - DirectCall("1716:call_weak_fn", condition()) - ) - ) - Block("1520:l00000598", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1712bv64) - ), - jumps( - DirectCall("1568:__libc_start_main", condition()) - ) - ) - Block("1712:l00000227", - statements( - LocalAssign(Register(R30, bv64) := 1716bv64) - ), - jumps( - DirectCall("1616:abort", condition()) - ) - ) - Block("?:l00000642", - statements( - ), - jumps( - DirectCall("1716:call_weak_fn", condition()) - ) - ) -)), -Procedure("1616:abort", in(), out(), blocks( -)), -Procedure("1716:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1716:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - ), - jumps( - GoTo("1732:l0000023d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1728:l00000461", condition()) - ) - ) - Block("1732:l0000023d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1728:l00000461", - statements( - ), - jumps( - GoTo("1600:l__gmon_start__", condition()) - ) - ) - Block("1600:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1744:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1744:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 40bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 40bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1788:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1768:l00000443", condition()) - ) - ) - Block("1768:l00000443", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) - ), - jumps( - GoTo("1788:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1780:l00000456", condition()) - ) - ) - Block("1788:l00000282", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1780:l00000456", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1936:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1936:lframe_dummy", - statements( - ), - jumps( - DirectCall("1792:register_tm_clones", condition()) - ) - ) -)), -Procedure("1940:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1940:lmain", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)])) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R0, bv64), 18446744073709551615bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Register(R1, bv64))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 3bv32), 32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R0, bv64), 4bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("++", 0bv24, Extract(Register(R0, bv64)[8:0])), 32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 40bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 40bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1848:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000425", condition()) - ) - ) - Block("1828:l00000425", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1848:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1840:l00000438", condition()) - ) - ) - Block("1848:l000002be", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1840:l00000438", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/jumptable/clang_O2/jumptable-before-analysis.il.expected b/src/test/correct/jumptable/clang_O2/jumptable-before-analysis.il.expected deleted file mode 100644 index bd68d2a77..000000000 --- a/src/test/correct/jumptable/clang_O2/jumptable-before-analysis.il.expected +++ /dev/null @@ -1,345 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 52bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000037f", condition()) - ) - ) - Block("1752:l0000037f", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000038d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003a6", condition()) - ) - ) - Block("1764:l000003a6", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000038d", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000399", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 52bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002d5", condition()) - ) - ) - Block("1788:l000002d5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1896:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l0000058e", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001ff", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000064d", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1832:add_six", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1832:ladd_six", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 48bv64)]), 32)) - LocalAssign(Register(R9, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R9, bv64)[32:0]), 6bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 48bv64)] := Extract(Register(R9, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1812:add_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1812:ladd_two", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 48bv64)]), 32)) - LocalAssign(Register(R9, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R9, bv64)[32:0]), 2bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 48bv64)] := Extract(Register(R9, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003f6", condition()) - ) - ) - Block("1604:l00000215", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003f6", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003d8", condition()) - ) - ) - Block("1640:l000003d8", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003eb", condition()) - ) - ) - Block("1660:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003eb", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1872:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1872:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 48bv64)]), 32)) - LocalAssign(Register(R9, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R9, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 48bv64)] := Extract(Register(R9, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003ba", condition()) - ) - ) - Block("1700:l000003ba", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003cd", condition()) - ) - ) - Block("1720:l00000296", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003cd", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1852:sub_seven", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1852:lsub_seven", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 48bv64)]), 32)) - LocalAssign(Register(R9, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R9, bv64)[32:0]), 4294967289bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 48bv64)] := Extract(Register(R9, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/jumptable/gcc_O2/jumptable-before-analysis.il.expected b/src/test/correct/jumptable/gcc_O2/jumptable-before-analysis.il.expected deleted file mode 100644 index 829c99cb2..000000000 --- a/src/test/correct/jumptable/gcc_O2/jumptable-before-analysis.il.expected +++ /dev/null @@ -1,373 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 20bv64)]), 56)) - ), - jumps( - GoTo("1852:l000003cd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000003fc", condition()) - ) - ) - Block("1816:l000003fc", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000040a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000423", condition()) - ) - ) - Block("1828:l00000423", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000040a", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000416", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 20bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000003cd", condition()) - ) - ) - Block("1852:l000003cd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1956:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1956:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l0000061a", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l000002f7", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000006e8", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1908:add_six", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1908:ladd_six", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 6bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1888:add_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1888:ladd_two", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 2bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l0000030d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000473", condition()) - ) - ) - Block("1668:l0000030d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000473", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) - LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000352", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000455", condition()) - ) - ) - Block("1704:l00000455", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000352", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000468", condition()) - ) - ) - Block("1724:l00000352", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000468", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(LocalVar(#1, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#1, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#1, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#1, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1548bv64) - ), - jumps( - DirectCall("1888:add_two", condition()) - ) - ) - Block("1548:l0000027c", - statements( - LocalAssign(Register(R30, bv64) := 1552bv64) - ), - jumps( - DirectCall("1908:add_six", condition()) - ) - ) - Block("1552:l00000283", - statements( - LocalAssign(Register(R30, bv64) := 1556bv64) - ), - jumps( - DirectCall("1936:sub_seven", condition()) - ) - ) - Block("1556:l0000028a", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000038e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000437", condition()) - ) - ) - Block("1764:l00000437", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l0000038e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000044a", condition()) - ) - ) - Block("1784:l0000038e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000044a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1936:sub_seven", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1936:lsub_seven", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/jumptable3/gcc/jumptable3-before-analysis.il.expected b/src/test/correct/jumptable3/gcc/jumptable3-before-analysis.il.expected deleted file mode 100644 index 66c205083..000000000 --- a/src/test/correct/jumptable3/gcc/jumptable3-before-analysis.il.expected +++ /dev/null @@ -1,893 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 20bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000048d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000009a5", condition()) - ) - ) - Block("1752:l000009a5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000009b3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009cc", condition()) - ) - ) - Block("1764:l000009cc", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000009b3", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009bf", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 20bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000048d", condition()) - ) - ) - Block("1788:l0000048d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2336:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2336:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#28, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#28, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#28, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#28, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000c22", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000003b7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000d66", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1848:add_six", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1848:ladd_six", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 6bv32), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1812:add_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1812:ladd_two", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 2bv32), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000003cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a1c", condition()) - ) - ) - Block("1604:l000003cd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a1c", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000412", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009fe", condition()) - ) - ) - Block("1640:l000009fe", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000412", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a11", condition()) - ) - ) - Block("1660:l00000412", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a11", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1920:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1920:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967284bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934581bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967285bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2296:l00000599", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1948:l000005e0", condition()) - ) - ) - Block("1948:l000005e0", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967284bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934581bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967285bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("1960:l00000608", condition()) - ) - ) - Block("1960:l00000608", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#7, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967285bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934582bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967286bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#7, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2284:l00000629", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1972:l00000643", condition()) - ) - ) - Block("2284:l00000629", - statements( - LocalAssign(Register(R30, bv64) := 2288bv64) - ), - jumps( - DirectCall("1884:sub_seven", condition()) - ) - ) - Block("2288:l00000635", - statements( - LocalAssign(Register(R30, bv64) := 2292bv64) - ), - jumps( - DirectCall("1812:add_two", condition()) - ) - ) - Block("2292:l0000063c", - statements( - LocalAssign(Register(R30, bv64) := 2296bv64) - ), - jumps( - DirectCall("1848:add_six", condition()) - ) - ) - Block("2296:l00000599", - statements( - LocalAssign(Register(R30, bv64) := 2300bv64) - ), - jumps( - DirectCall("1884:sub_seven", condition()) - ) - ) - Block("2300:l000005a5", - statements( - LocalAssign(Register(R30, bv64) := 2304bv64) - ), - jumps( - DirectCall("1812:add_two", condition()) - ) - ) - Block("2304:l000005ac", - statements( - ), - jumps( - GoTo("2316:l000005ad", condition()) - ) - ) - Block("1972:l00000643", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#8, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967285bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934582bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967286bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#8, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("1984:l0000066b", condition()) - ) - ) - Block("1984:l0000066b", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#9, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967286bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934583bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967287bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#9, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2272:l0000068c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1996:l000006a3", condition()) - ) - ) - Block("2272:l0000068c", - statements( - LocalAssign(Register(R30, bv64) := 2276bv64) - ), - jumps( - DirectCall("1812:add_two", condition()) - ) - ) - Block("2276:l00000698", - statements( - LocalAssign(Register(R30, bv64) := 2280bv64) - ), - jumps( - DirectCall("1848:add_six", condition()) - ) - ) - Block("2280:l0000069f", - statements( - ), - jumps( - GoTo("2316:l000005ad", condition()) - ) - ) - Block("1996:l000006a3", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#10, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967286bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934583bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967287bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#10, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2008:l000006cb", condition()) - ) - ) - Block("2008:l000006cb", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#11, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967287bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934584bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967288bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#11, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2260:l000006ec", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2020:l00000703", condition()) - ) - ) - Block("2020:l00000703", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#12, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967287bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934584bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967288bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#12, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2032:l0000072b", condition()) - ) - ) - Block("2032:l0000072b", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#13, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967288bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934585bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967289bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#13, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2256:l0000074c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2044:l00000758", condition()) - ) - ) - Block("2044:l00000758", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#14, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967288bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#14, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934585bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#14, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967289bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#14, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#14, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2056:l00000780", condition()) - ) - ) - Block("2056:l00000780", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#15, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#15, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934586bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#15, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967290bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#15, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#15, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2252:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2068:l000007ad", condition()) - ) - ) - Block("2068:l000007ad", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#16, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#16, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934586bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#16, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967290bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#16, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#16, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2080:l000007d5", condition()) - ) - ) - Block("2080:l000007d5", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#17, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#17, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#17, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#17, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#17, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2244:l000007f6", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2092:l00000809", condition()) - ) - ) - Block("2244:l000007f6", - statements( - LocalAssign(Register(R30, bv64) := 2248bv64) - ), - jumps( - DirectCall("1848:add_six", condition()) - ) - ) - Block("2248:l00000802", - statements( - LocalAssign(Register(R30, bv64) := 2252bv64) - ), - jumps( - DirectCall("1812:add_two", condition()) - ) - ) - Block("2252:l000007a1", - statements( - LocalAssign(Register(R30, bv64) := 2256bv64) - ), - jumps( - DirectCall("1848:add_six", condition()) - ) - ) - Block("2256:l0000074c", - statements( - LocalAssign(Register(R30, bv64) := 2260bv64) - ), - jumps( - DirectCall("1884:sub_seven", condition()) - ) - ) - Block("2260:l000006ec", - statements( - LocalAssign(Register(R30, bv64) := 2264bv64) - ), - jumps( - DirectCall("1884:sub_seven", condition()) - ) - ) - Block("2264:l000006f8", - statements( - LocalAssign(Register(R30, bv64) := 2268bv64) - ), - jumps( - DirectCall("1848:add_six", condition()) - ) - ) - Block("2268:l000006ff", - statements( - ), - jumps( - GoTo("2316:l000005ad", condition()) - ) - ) - Block("2092:l00000809", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#18, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#18, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#18, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#18, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#18, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2104:l00000831", condition()) - ) - ) - Block("2104:l00000831", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#19, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#19, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#19, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#19, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#19, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2236:l00000852", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2116:l00000862", condition()) - ) - ) - Block("2236:l00000852", - statements( - LocalAssign(Register(R30, bv64) := 2240bv64) - ), - jumps( - DirectCall("1848:add_six", condition()) - ) - ) - Block("2240:l0000085e", - statements( - ), - jumps( - GoTo("2316:l000005ad", condition()) - ) - ) - Block("2116:l00000862", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#20, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#20, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#20, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#20, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#20, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2128:l0000088a", condition()) - ) - ) - Block("2128:l0000088a", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#21, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#21, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#21, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#21, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#21, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2224:l000008ab", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2140:l000008c2", condition()) - ) - ) - Block("2224:l000008ab", - statements( - LocalAssign(Register(R30, bv64) := 2228bv64) - ), - jumps( - DirectCall("1812:add_two", condition()) - ) - ) - Block("2228:l000008b7", - statements( - LocalAssign(Register(R30, bv64) := 2232bv64) - ), - jumps( - DirectCall("1884:sub_seven", condition()) - ) - ) - Block("2232:l000008be", - statements( - ), - jumps( - GoTo("2316:l000005ad", condition()) - ) - ) - Block("2140:l000008c2", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#22, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#22, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#22, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#22, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#22, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2152:l000008ea", condition()) - ) - ) - Block("2152:l000008ea", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#23, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#23, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#23, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#23, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#23, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2216:l0000090b", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2164:l0000091b", condition()) - ) - ) - Block("2164:l0000091b", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#24, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#24, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#24, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#24, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#24, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l000005d7", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2176:l00000943", condition()) - ) - ) - Block("2176:l00000943", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#25, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#25, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#25, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#25, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#25, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2204:l00000964", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2188:l0000097b", condition()) - ) - ) - Block("2204:l00000964", - statements( - LocalAssign(Register(R30, bv64) := 2208bv64) - ), - jumps( - DirectCall("1812:add_two", condition()) - ) - ) - Block("2208:l00000970", - statements( - ), - jumps( - GoTo("2316:l000005ad", condition()) - ) - ) - Block("2188:l0000097b", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#26, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#26, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#26, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#26, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#26, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2212:l00000974", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2200:l000009a1", condition()) - ) - ) - Block("2212:l00000974", - statements( - LocalAssign(Register(R30, bv64) := 2216bv64) - ), - jumps( - DirectCall("1848:add_six", condition()) - ) - ) - Block("2216:l0000090b", - statements( - LocalAssign(Register(R30, bv64) := 2220bv64) - ), - jumps( - DirectCall("1884:sub_seven", condition()) - ) - ) - Block("2220:l00000917", - statements( - ), - jumps( - GoTo("2316:l000005ad", condition()) - ) - ) - Block("2316:l000005ad", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - ), - jumps( - GoTo("2328:l000005c2", condition()) - ) - ) - Block("2200:l000009a1", - statements( - ), - jumps( - GoTo("2308:l000005d7", condition()) - ) - ) - Block("2308:l000005d7", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - ), - jumps( - GoTo("2328:l000005c2", condition()) - ) - ) - Block("2328:l000005c2", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000044e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009e0", condition()) - ) - ) - Block("1700:l000009e0", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000044e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009f3", condition()) - ) - ) - Block("1720:l0000044e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009f3", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1884:sub_seven", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1884:lsub_seven", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/jumptable3/gcc_O2/jumptable3-before-analysis.il.expected b/src/test/correct/jumptable3/gcc_O2/jumptable3-before-analysis.il.expected deleted file mode 100644 index 820d2312d..000000000 --- a/src/test/correct/jumptable3/gcc_O2/jumptable3-before-analysis.il.expected +++ /dev/null @@ -1,636 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2048:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2048:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 20bv64)]), 56)) - ), - jumps( - GoTo("2108:l00000497", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2072:l00000527", condition()) - ) - ) - Block("2072:l00000527", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("2096:l00000535", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2084:l0000054e", condition()) - ) - ) - Block("2084:l0000054e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2096bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("2096:l00000535", - statements( - LocalAssign(Register(R30, bv64) := 2100bv64) - ), - jumps( - DirectCall("1936:deregister_tm_clones", condition()) - ) - ) - Block("2100:l00000541", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 20bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2108:l00000497", condition()) - ) - ) - Block("2108:l00000497", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2212:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2212:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#15, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#15, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#15, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#15, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1908:call_weak_fn", condition()) - ) - ) - Block("1424:l000009a9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1856:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1904bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1904:l000003c1", - statements( - LocalAssign(Register(R30, bv64) := 1908bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000ac8", - statements( - ), - jumps( - DirectCall("1908:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("2164:add_six", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2164:ladd_six", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 6bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("2144:add_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2144:ladd_two", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 2bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1908:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1908:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1924:l000003d7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1920:l0000059e", condition()) - ) - ) - Block("1924:l000003d7", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1920:l0000059e", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1936:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1936:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) - LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1980:l0000041c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1960:l00000580", condition()) - ) - ) - Block("1960:l00000580", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1980:l0000041c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1972:l00000593", condition()) - ) - ) - Block("1980:l0000041c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1972:l00000593", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2128:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2128:lframe_dummy", - statements( - ), - jumps( - DirectCall("1984:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(LocalVar(#1, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#1, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934586bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#1, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967290bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#1, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#1, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1644:l00000317", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1548:l00000753", condition()) - ) - ) - Block("1548:l00000753", - statements( - ), - jumps( - GoTo("1672:l000006e8", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("1552:l0000075c", condition()) - ) - ) - Block("1672:l000006e8", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(LocalVar(#8, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967286bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934583bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967287bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#8, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1808:l000005f9", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1684:l0000070c", condition()) - ) - ) - Block("1808:l000005f9", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 8bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1596:l00000360", condition()) - ) - ) - Block("1684:l0000070c", - statements( - ), - jumps( - GoTo("1720:l00000644", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1))), 0bv1))) - GoTo("1688:l00000715", condition()) - ) - ) - Block("1720:l00000644", - statements( - LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967288bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934585bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967289bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1656:l00000331", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1728:l00000663", condition()) - ) - ) - Block("1728:l00000663", - statements( - LocalAssign(LocalVar(#7, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967287bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934584bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967288bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#7, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1840:l0000036b", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1736:l00000347", condition()) - ) - ) - Block("1688:l00000715", - statements( - LocalAssign(LocalVar(#9, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967285bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934582bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967286bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#9, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1824:l00000612", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1696:l00000734", condition()) - ) - ) - Block("1824:l00000612", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1704:l00000628", condition()) - ) - ) - Block("1696:l00000734", - statements( - LocalAssign(LocalVar(#10, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967284bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934581bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967285bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#10, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1840:l0000036b", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1704:l00000628", condition()) - ) - ) - Block("1704:l00000628", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1596:l00000360", condition()) - ) - ) - Block("1552:l0000075c", - statements( - LocalAssign(LocalVar(#11, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#11, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1752:l0000069c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1560:l0000077b", condition()) - ) - ) - Block("1752:l0000069c", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1596:l00000360", condition()) - ) - ) - Block("1560:l0000077b", - statements( - ), - jumps( - GoTo("1620:l000005bc", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("1564:l00000784", condition()) - ) - ) - Block("1620:l000005bc", - statements( - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1788:l000005d6", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1628:l00000682", condition()) - ) - ) - Block("1788:l000005d6", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 6bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1596:l00000360", condition()) - ) - ) - Block("1628:l00000682", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 8bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1644:l00000317", condition()) - ) - ) - Block("1644:l00000317", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 6bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1656:l00000331", condition()) - ) - ) - Block("1656:l00000331", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1736:l00000347", condition()) - ) - ) - Block("1736:l00000347", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1596:l00000360", condition()) - ) - ) - Block("1564:l00000784", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(LocalVar(#12, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#12, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1772:l000006ba", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1576:l000007a8", condition()) - ) - ) - Block("1772:l000006ba", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 6bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1584:l000006d0", condition()) - ) - ) - Block("1576:l000007a8", - statements( - LocalAssign(LocalVar(#13, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#13, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1600:l00000368", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1584:l000006d0", condition()) - ) - ) - Block("1600:l00000368", - statements( - ), - jumps( - GoTo("1840:l0000036b", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1604:l000005a3", condition()) - ) - ) - Block("1840:l0000036b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1604:l000005a3", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 2bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1596:l00000360", condition()) - ) - ) - Block("1584:l000006d0", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1596:l00000360", condition()) - ) - ) - Block("1596:l00000360", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1984:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("2040:l00000458", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000562", condition()) - ) - ) - Block("2020:l00000562", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("2040:l00000458", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("2032:l00000575", condition()) - ) - ) - Block("2040:l00000458", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("2032:l00000575", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2192:sub_seven", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2192:lsub_seven", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 16bv64)]), 32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 16bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/jumptable3/gcc_no_plt_no_pic/jumptable3-before-analysis.il.expected b/src/test/correct/jumptable3/gcc_no_plt_no_pic/jumptable3-before-analysis.il.expected deleted file mode 100644 index 58774350b..000000000 --- a/src/test/correct/jumptable3/gcc_no_plt_no_pic/jumptable3-before-analysis.il.expected +++ /dev/null @@ -1,893 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 20bv64)]), 56)) - ), - jumps( - GoTo("1788:l000011e8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00001700", condition()) - ) - ) - Block("1752:l00001700", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l0000170e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00001727", condition()) - ) - ) - Block("1764:l00001727", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000170e", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000171a", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 20bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000011e8", condition()) - ) - ) - Block("1788:l000011e8", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2336:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2336:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#28, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#28, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#28, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#28, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l0000197d", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00001112", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00001a82", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1848:add_six", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1848:ladd_six", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 6bv32), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1812:add_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1812:ladd_two", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 2bv32), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00001128", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00001777", condition()) - ) - ) - Block("1604:l00001128", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00001777", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000116d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00001759", condition()) - ) - ) - Block("1640:l00001759", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000116d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000176c", condition()) - ) - ) - Block("1660:l0000116d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000176c", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1920:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1920:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967284bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934581bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967285bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2296:l000012f4", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1948:l0000133b", condition()) - ) - ) - Block("1948:l0000133b", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967284bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934581bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967285bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("1960:l00001363", condition()) - ) - ) - Block("1960:l00001363", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#7, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967285bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934582bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967286bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#7, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2284:l00001384", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1972:l0000139e", condition()) - ) - ) - Block("2284:l00001384", - statements( - LocalAssign(Register(R30, bv64) := 2288bv64) - ), - jumps( - DirectCall("1884:sub_seven", condition()) - ) - ) - Block("2288:l00001390", - statements( - LocalAssign(Register(R30, bv64) := 2292bv64) - ), - jumps( - DirectCall("1812:add_two", condition()) - ) - ) - Block("2292:l00001397", - statements( - LocalAssign(Register(R30, bv64) := 2296bv64) - ), - jumps( - DirectCall("1848:add_six", condition()) - ) - ) - Block("2296:l000012f4", - statements( - LocalAssign(Register(R30, bv64) := 2300bv64) - ), - jumps( - DirectCall("1884:sub_seven", condition()) - ) - ) - Block("2300:l00001300", - statements( - LocalAssign(Register(R30, bv64) := 2304bv64) - ), - jumps( - DirectCall("1812:add_two", condition()) - ) - ) - Block("2304:l00001307", - statements( - ), - jumps( - GoTo("2316:l00001308", condition()) - ) - ) - Block("1972:l0000139e", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#8, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967285bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934582bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967286bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#8, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("1984:l000013c6", condition()) - ) - ) - Block("1984:l000013c6", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#9, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967286bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934583bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967287bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#9, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2272:l000013e7", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1996:l000013fe", condition()) - ) - ) - Block("2272:l000013e7", - statements( - LocalAssign(Register(R30, bv64) := 2276bv64) - ), - jumps( - DirectCall("1812:add_two", condition()) - ) - ) - Block("2276:l000013f3", - statements( - LocalAssign(Register(R30, bv64) := 2280bv64) - ), - jumps( - DirectCall("1848:add_six", condition()) - ) - ) - Block("2280:l000013fa", - statements( - ), - jumps( - GoTo("2316:l00001308", condition()) - ) - ) - Block("1996:l000013fe", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#10, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967286bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934583bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967287bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#10, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2008:l00001426", condition()) - ) - ) - Block("2008:l00001426", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#11, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967287bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934584bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967288bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#11, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2260:l00001447", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2020:l0000145e", condition()) - ) - ) - Block("2020:l0000145e", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#12, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967287bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934584bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967288bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#12, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2032:l00001486", condition()) - ) - ) - Block("2032:l00001486", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#13, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967288bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934585bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967289bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#13, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2256:l000014a7", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2044:l000014b3", condition()) - ) - ) - Block("2044:l000014b3", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#14, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967288bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#14, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934585bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#14, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967289bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#14, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#14, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2056:l000014db", condition()) - ) - ) - Block("2056:l000014db", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#15, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#15, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934586bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#15, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967290bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#15, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#15, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2252:l000014fc", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2068:l00001508", condition()) - ) - ) - Block("2068:l00001508", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#16, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#16, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934586bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#16, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967290bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#16, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#16, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2080:l00001530", condition()) - ) - ) - Block("2080:l00001530", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#17, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#17, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#17, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#17, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#17, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2244:l00001551", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2092:l00001564", condition()) - ) - ) - Block("2244:l00001551", - statements( - LocalAssign(Register(R30, bv64) := 2248bv64) - ), - jumps( - DirectCall("1848:add_six", condition()) - ) - ) - Block("2248:l0000155d", - statements( - LocalAssign(Register(R30, bv64) := 2252bv64) - ), - jumps( - DirectCall("1812:add_two", condition()) - ) - ) - Block("2252:l000014fc", - statements( - LocalAssign(Register(R30, bv64) := 2256bv64) - ), - jumps( - DirectCall("1848:add_six", condition()) - ) - ) - Block("2256:l000014a7", - statements( - LocalAssign(Register(R30, bv64) := 2260bv64) - ), - jumps( - DirectCall("1884:sub_seven", condition()) - ) - ) - Block("2260:l00001447", - statements( - LocalAssign(Register(R30, bv64) := 2264bv64) - ), - jumps( - DirectCall("1884:sub_seven", condition()) - ) - ) - Block("2264:l00001453", - statements( - LocalAssign(Register(R30, bv64) := 2268bv64) - ), - jumps( - DirectCall("1848:add_six", condition()) - ) - ) - Block("2268:l0000145a", - statements( - ), - jumps( - GoTo("2316:l00001308", condition()) - ) - ) - Block("2092:l00001564", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#18, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#18, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#18, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#18, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#18, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2104:l0000158c", condition()) - ) - ) - Block("2104:l0000158c", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#19, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#19, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#19, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#19, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#19, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2236:l000015ad", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2116:l000015bd", condition()) - ) - ) - Block("2236:l000015ad", - statements( - LocalAssign(Register(R30, bv64) := 2240bv64) - ), - jumps( - DirectCall("1848:add_six", condition()) - ) - ) - Block("2240:l000015b9", - statements( - ), - jumps( - GoTo("2316:l00001308", condition()) - ) - ) - Block("2116:l000015bd", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#20, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#20, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#20, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#20, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#20, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2128:l000015e5", condition()) - ) - ) - Block("2128:l000015e5", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#21, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#21, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#21, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#21, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#21, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2224:l00001606", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2140:l0000161d", condition()) - ) - ) - Block("2224:l00001606", - statements( - LocalAssign(Register(R30, bv64) := 2228bv64) - ), - jumps( - DirectCall("1812:add_two", condition()) - ) - ) - Block("2228:l00001612", - statements( - LocalAssign(Register(R30, bv64) := 2232bv64) - ), - jumps( - DirectCall("1884:sub_seven", condition()) - ) - ) - Block("2232:l00001619", - statements( - ), - jumps( - GoTo("2316:l00001308", condition()) - ) - ) - Block("2140:l0000161d", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#22, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#22, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#22, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#22, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#22, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2152:l00001645", condition()) - ) - ) - Block("2152:l00001645", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#23, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#23, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#23, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#23, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#23, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2216:l00001666", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2164:l00001676", condition()) - ) - ) - Block("2164:l00001676", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#24, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#24, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#24, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#24, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#24, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l00001332", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2176:l0000169e", condition()) - ) - ) - Block("2176:l0000169e", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#25, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#25, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#25, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#25, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#25, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2204:l000016bf", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2188:l000016d6", condition()) - ) - ) - Block("2204:l000016bf", - statements( - LocalAssign(Register(R30, bv64) := 2208bv64) - ), - jumps( - DirectCall("1812:add_two", condition()) - ) - ) - Block("2208:l000016cb", - statements( - ), - jumps( - GoTo("2316:l00001308", condition()) - ) - ) - Block("2188:l000016d6", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#26, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#26, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#26, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#26, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#26, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2212:l000016cf", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2200:l000016fc", condition()) - ) - ) - Block("2212:l000016cf", - statements( - LocalAssign(Register(R30, bv64) := 2216bv64) - ), - jumps( - DirectCall("1848:add_six", condition()) - ) - ) - Block("2216:l00001666", - statements( - LocalAssign(Register(R30, bv64) := 2220bv64) - ), - jumps( - DirectCall("1884:sub_seven", condition()) - ) - ) - Block("2220:l00001672", - statements( - ), - jumps( - GoTo("2316:l00001308", condition()) - ) - ) - Block("2316:l00001308", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - ), - jumps( - GoTo("2328:l0000131d", condition()) - ) - ) - Block("2200:l000016fc", - statements( - ), - jumps( - GoTo("2308:l00001332", condition()) - ) - ) - Block("2308:l00001332", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - ), - jumps( - GoTo("2328:l0000131d", condition()) - ) - ) - Block("2328:l0000131d", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000011a9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000173b", condition()) - ) - ) - Block("1700:l0000173b", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000011a9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000174e", condition()) - ) - ) - Block("1720:l000011a9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000174e", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1884:sub_seven", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1884:lsub_seven", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/jumptable3/gcc_pic/jumptable3-before-analysis.il.expected b/src/test/correct/jumptable3/gcc_pic/jumptable3-before-analysis.il.expected deleted file mode 100644 index e0e6e799f..000000000 --- a/src/test/correct/jumptable3/gcc_pic/jumptable3-before-analysis.il.expected +++ /dev/null @@ -1,893 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 20bv64)]), 56)) - ), - jumps( - GoTo("1852:l0000048d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000009ac", condition()) - ) - ) - Block("1816:l000009ac", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - ), - jumps( - GoTo("1840:l000009ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l000009d3", condition()) - ) - ) - Block("1828:l000009d3", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l000009ba", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000009c6", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 20bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l0000048d", condition()) - ) - ) - Block("1852:l0000048d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2400:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2400:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#28, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#28, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#28, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#28, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l00000b5a", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000003b7", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l00000c9e", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1912:add_six", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1912:ladd_six", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 6bv32), 32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1876:add_two", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:ladd_two", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 2bv32), 32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l000003cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000a23", condition()) - ) - ) - Block("1668:l000003cd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000a23", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000412", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000a05", condition()) - ) - ) - Block("1704:l00000a05", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) - ), - jumps( - GoTo("1724:l00000412", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000a18", condition()) - ) - ) - Block("1724:l00000412", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000a18", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1984:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1984:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967284bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934581bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967285bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2360:l0000059f", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2012:l000005e7", condition()) - ) - ) - Block("2012:l000005e7", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967284bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934581bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967285bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2024:l0000060f", condition()) - ) - ) - Block("2024:l0000060f", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#7, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967285bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934582bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967286bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#7, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2348:l00000630", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2036:l0000064a", condition()) - ) - ) - Block("2348:l00000630", - statements( - LocalAssign(Register(R30, bv64) := 2352bv64) - ), - jumps( - DirectCall("1948:sub_seven", condition()) - ) - ) - Block("2352:l0000063c", - statements( - LocalAssign(Register(R30, bv64) := 2356bv64) - ), - jumps( - DirectCall("1876:add_two", condition()) - ) - ) - Block("2356:l00000643", - statements( - LocalAssign(Register(R30, bv64) := 2360bv64) - ), - jumps( - DirectCall("1912:add_six", condition()) - ) - ) - Block("2360:l0000059f", - statements( - LocalAssign(Register(R30, bv64) := 2364bv64) - ), - jumps( - DirectCall("1948:sub_seven", condition()) - ) - ) - Block("2364:l000005ab", - statements( - LocalAssign(Register(R30, bv64) := 2368bv64) - ), - jumps( - DirectCall("1876:add_two", condition()) - ) - ) - Block("2368:l000005b2", - statements( - ), - jumps( - GoTo("2380:l000005b3", condition()) - ) - ) - Block("2036:l0000064a", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#8, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967285bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934582bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967286bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#8, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2048:l00000672", condition()) - ) - ) - Block("2048:l00000672", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#9, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967286bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934583bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967287bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#9, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2336:l00000693", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2060:l000006aa", condition()) - ) - ) - Block("2336:l00000693", - statements( - LocalAssign(Register(R30, bv64) := 2340bv64) - ), - jumps( - DirectCall("1876:add_two", condition()) - ) - ) - Block("2340:l0000069f", - statements( - LocalAssign(Register(R30, bv64) := 2344bv64) - ), - jumps( - DirectCall("1912:add_six", condition()) - ) - ) - Block("2344:l000006a6", - statements( - ), - jumps( - GoTo("2380:l000005b3", condition()) - ) - ) - Block("2060:l000006aa", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#10, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967286bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934583bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967287bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#10, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2072:l000006d2", condition()) - ) - ) - Block("2072:l000006d2", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#11, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967287bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934584bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967288bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#11, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2324:l000006f3", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2084:l0000070a", condition()) - ) - ) - Block("2084:l0000070a", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#12, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967287bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934584bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967288bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#12, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2096:l00000732", condition()) - ) - ) - Block("2096:l00000732", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#13, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967288bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934585bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967289bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#13, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#13, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2320:l00000753", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2108:l0000075f", condition()) - ) - ) - Block("2108:l0000075f", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#14, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967288bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#14, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934585bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#14, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967289bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#14, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#14, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2120:l00000787", condition()) - ) - ) - Block("2120:l00000787", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#15, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#15, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934586bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#15, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967290bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#15, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#15, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2316:l000007a8", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2132:l000007b4", condition()) - ) - ) - Block("2132:l000007b4", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#16, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#16, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934586bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#16, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967290bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#16, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#16, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2144:l000007dc", condition()) - ) - ) - Block("2144:l000007dc", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#17, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#17, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#17, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#17, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#17, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2308:l000007fd", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2156:l00000810", condition()) - ) - ) - Block("2308:l000007fd", - statements( - LocalAssign(Register(R30, bv64) := 2312bv64) - ), - jumps( - DirectCall("1912:add_six", condition()) - ) - ) - Block("2312:l00000809", - statements( - LocalAssign(Register(R30, bv64) := 2316bv64) - ), - jumps( - DirectCall("1876:add_two", condition()) - ) - ) - Block("2316:l000007a8", - statements( - LocalAssign(Register(R30, bv64) := 2320bv64) - ), - jumps( - DirectCall("1912:add_six", condition()) - ) - ) - Block("2320:l00000753", - statements( - LocalAssign(Register(R30, bv64) := 2324bv64) - ), - jumps( - DirectCall("1948:sub_seven", condition()) - ) - ) - Block("2324:l000006f3", - statements( - LocalAssign(Register(R30, bv64) := 2328bv64) - ), - jumps( - DirectCall("1948:sub_seven", condition()) - ) - ) - Block("2328:l000006ff", - statements( - LocalAssign(Register(R30, bv64) := 2332bv64) - ), - jumps( - DirectCall("1912:add_six", condition()) - ) - ) - Block("2332:l00000706", - statements( - ), - jumps( - GoTo("2380:l000005b3", condition()) - ) - ) - Block("2156:l00000810", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#18, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#18, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#18, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#18, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#18, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2168:l00000838", condition()) - ) - ) - Block("2168:l00000838", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#19, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#19, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#19, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#19, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#19, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2300:l00000859", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2180:l00000869", condition()) - ) - ) - Block("2300:l00000859", - statements( - LocalAssign(Register(R30, bv64) := 2304bv64) - ), - jumps( - DirectCall("1912:add_six", condition()) - ) - ) - Block("2304:l00000865", - statements( - ), - jumps( - GoTo("2380:l000005b3", condition()) - ) - ) - Block("2180:l00000869", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#20, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#20, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#20, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#20, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#20, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2192:l00000891", condition()) - ) - ) - Block("2192:l00000891", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#21, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#21, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#21, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#21, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#21, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2288:l000008b2", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2204:l000008c9", condition()) - ) - ) - Block("2288:l000008b2", - statements( - LocalAssign(Register(R30, bv64) := 2292bv64) - ), - jumps( - DirectCall("1876:add_two", condition()) - ) - ) - Block("2292:l000008be", - statements( - LocalAssign(Register(R30, bv64) := 2296bv64) - ), - jumps( - DirectCall("1948:sub_seven", condition()) - ) - ) - Block("2296:l000008c5", - statements( - ), - jumps( - GoTo("2380:l000005b3", condition()) - ) - ) - Block("2204:l000008c9", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#22, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#22, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#22, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#22, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#22, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2216:l000008f1", condition()) - ) - ) - Block("2216:l000008f1", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#23, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#23, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#23, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#23, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#23, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2280:l00000912", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2228:l00000922", condition()) - ) - ) - Block("2228:l00000922", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#24, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#24, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#24, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#24, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#24, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2372:l000005de", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("2240:l0000094a", condition()) - ) - ) - Block("2240:l0000094a", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#25, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#25, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#25, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#25, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#25, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2268:l0000096b", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2252:l00000982", condition()) - ) - ) - Block("2268:l0000096b", - statements( - LocalAssign(Register(R30, bv64) := 2272bv64) - ), - jumps( - DirectCall("1876:add_two", condition()) - ) - ) - Block("2272:l00000977", - statements( - ), - jumps( - GoTo("2380:l000005b3", condition()) - ) - ) - Block("2252:l00000982", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#26, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#26, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#26, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#26, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#26, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("2276:l0000097b", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2264:l000009a8", condition()) - ) - ) - Block("2276:l0000097b", - statements( - LocalAssign(Register(R30, bv64) := 2280bv64) - ), - jumps( - DirectCall("1912:add_six", condition()) - ) - ) - Block("2280:l00000912", - statements( - LocalAssign(Register(R30, bv64) := 2284bv64) - ), - jumps( - DirectCall("1948:sub_seven", condition()) - ) - ) - Block("2284:l0000091e", - statements( - ), - jumps( - GoTo("2380:l000005b3", condition()) - ) - ) - Block("2380:l000005b3", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - ), - jumps( - GoTo("2392:l000005c9", condition()) - ) - ) - Block("2264:l000009a8", - statements( - ), - jumps( - GoTo("2372:l000005de", condition()) - ) - ) - Block("2372:l000005de", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - ), - jumps( - GoTo("2392:l000005c9", condition()) - ) - ) - Block("2392:l000005c9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000044e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009e7", condition()) - ) - ) - Block("1764:l000009e7", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l0000044e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000009fa", condition()) - ) - ) - Block("1784:l0000044e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000009fa", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1948:sub_seven", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1948:lsub_seven", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967289bv32), 32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local/clang/malloc_with_local-before-analysis.il.expected b/src/test/correct/malloc_with_local/clang/malloc_with_local-before-analysis.il.expected deleted file mode 100644 index 050cfe8ef..000000000 --- a/src/test/correct/malloc_with_local/clang/malloc_with_local-before-analysis.il.expected +++ /dev/null @@ -1,401 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000329", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l0000047b", condition()) - ) - ) - Block("2008:l0000047b", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("2032:l00000489", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l000004a2", condition()) - ) - ) - Block("2020:l000004a2", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l00000489", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000495", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000329", condition()) - ) - ) - Block("2044:l00000329", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2236:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2236:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l0000069b", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l00000253", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l00000753", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1860:l00000269", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l000004f2", condition()) - ) - ) - Block("1860:l00000269", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l000004f2", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l000002ae", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l000004d4", condition()) - ) - ) - Block("1896:l000004d4", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1916:l000002ae", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l000004e7", condition()) - ) - ) - Block("1916:l000002ae", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l000004e7", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - LocalAssign(Register(R8, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2100bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2100:l00000391", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2112bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2112:l000003a5", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) - LocalAssign(Register(R8, bv64) := 10bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R8, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R8, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2260bv64)) - LocalAssign(Register(R30, bv64) := 2168bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2168:l00000403", - statements( - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2277bv64)) - LocalAssign(Register(R30, bv64) := 2188bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2188:l00000423", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2293bv64)) - LocalAssign(Register(R30, bv64) := 2204bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2204:l0000043c", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R30, bv64) := 2212bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2212:l0000044b", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2220bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2220:l00000459", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)]), 32)) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l000002ea", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l000004b6", condition()) - ) - ) - Block("1956:l000004b6", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1976:l000002ea", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l000004c9", condition()) - ) - ) - Block("1976:l000002ea", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l000004c9", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local/clang_O2/malloc_with_local-before-analysis.il.expected b/src/test/correct/malloc_with_local/clang_O2/malloc_with_local-before-analysis.il.expected deleted file mode 100644 index 425e44c2f..000000000 --- a/src/test/correct/malloc_with_local/clang_O2/malloc_with_local-before-analysis.il.expected +++ /dev/null @@ -1,345 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000036a", condition()) - ) - ) - Block("1816:l0000036a", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1840:l00000378", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000391", condition()) - ) - ) - Block("1828:l00000391", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000378", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000384", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002c5", condition()) - ) - ) - Block("1852:l000002c5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1944:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1464:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1480bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1480:l0000059b", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001ef", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l00000632", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003e1", condition()) - ) - ) - Block("1668:l00000205", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003e1", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003c3", condition()) - ) - ) - Block("1704:l000003c3", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003d6", condition()) - ) - ) - Block("1724:l0000024a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003d6", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1968bv64)) - LocalAssign(Register(R1, bv64) := 65bv64) - LocalAssign(Register(R30, bv64) := 1900bv64) - ), - jumps( - DirectCall("1584:printf", condition()) - ) - ) - Block("1900:l00000322", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1985bv64)) - LocalAssign(Register(R1, bv64) := 42bv64) - LocalAssign(Register(R30, bv64) := 1916bv64) - ), - jumps( - DirectCall("1584:printf", condition()) - ) - ) - Block("1916:l00000339", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2001bv64)) - LocalAssign(Register(R1, bv64) := 10bv64) - LocalAssign(Register(R30, bv64) := 1932bv64) - ), - jumps( - DirectCall("1584:printf", condition()) - ) - ) - Block("1932:l00000350", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1584:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003a5", condition()) - ) - ) - Block("1764:l000003a5", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003b8", condition()) - ) - ) - Block("1784:l00000286", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003b8", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local/clang_no_plt_no_pic/malloc_with_local-before-analysis.il.expected b/src/test/correct/malloc_with_local/clang_no_plt_no_pic/malloc_with_local-before-analysis.il.expected deleted file mode 100644 index 358645009..000000000 --- a/src/test/correct/malloc_with_local/clang_no_plt_no_pic/malloc_with_local-before-analysis.il.expected +++ /dev/null @@ -1,401 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000a9b", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l00000bed", condition()) - ) - ) - Block("2008:l00000bed", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("2032:l00000bfb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000c14", condition()) - ) - ) - Block("2020:l00000c14", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l00000bfb", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000c07", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000a9b", condition()) - ) - ) - Block("2044:l00000a9b", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2236:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2236:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l00000e0d", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l000009c5", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l00000ec5", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1860:l000009db", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000c64", condition()) - ) - ) - Block("1860:l000009db", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000c64", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l00000a20", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000c46", condition()) - ) - ) - Block("1896:l00000c46", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1916:l00000a20", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000c59", condition()) - ) - ) - Block("1916:l00000a20", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000c59", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - LocalAssign(Register(R8, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2100bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2100:l00000b03", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2112bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2112:l00000b17", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) - LocalAssign(Register(R8, bv64) := 10bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R8, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R8, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2260bv64)) - LocalAssign(Register(R30, bv64) := 2168bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2168:l00000b75", - statements( - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2277bv64)) - LocalAssign(Register(R30, bv64) := 2188bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2188:l00000b95", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2293bv64)) - LocalAssign(Register(R30, bv64) := 2204bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2204:l00000bae", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R30, bv64) := 2212bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2212:l00000bbd", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2220bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2220:l00000bcb", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)]), 32)) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l00000a5c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000c28", condition()) - ) - ) - Block("1956:l00000c28", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1976:l00000a5c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l00000c3b", condition()) - ) - ) - Block("1976:l00000a5c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l00000c3b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local/clang_pic/malloc_with_local-before-analysis.il.expected b/src/test/correct/malloc_with_local/clang_pic/malloc_with_local-before-analysis.il.expected deleted file mode 100644 index 358645009..000000000 --- a/src/test/correct/malloc_with_local/clang_pic/malloc_with_local-before-analysis.il.expected +++ /dev/null @@ -1,401 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000a9b", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l00000bed", condition()) - ) - ) - Block("2008:l00000bed", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("2032:l00000bfb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000c14", condition()) - ) - ) - Block("2020:l00000c14", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l00000bfb", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000c07", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000a9b", condition()) - ) - ) - Block("2044:l00000a9b", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2236:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2236:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l00000e0d", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l000009c5", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l00000ec5", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1860:l000009db", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000c64", condition()) - ) - ) - Block("1860:l000009db", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000c64", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l00000a20", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000c46", condition()) - ) - ) - Block("1896:l00000c46", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1916:l00000a20", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000c59", condition()) - ) - ) - Block("1916:l00000a20", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000c59", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - LocalAssign(Register(R8, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2100bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2100:l00000b03", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2112bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2112:l00000b17", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) - LocalAssign(Register(R8, bv64) := 10bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R8, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R8, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2260bv64)) - LocalAssign(Register(R30, bv64) := 2168bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2168:l00000b75", - statements( - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2277bv64)) - LocalAssign(Register(R30, bv64) := 2188bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2188:l00000b95", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2293bv64)) - LocalAssign(Register(R30, bv64) := 2204bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2204:l00000bae", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R30, bv64) := 2212bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2212:l00000bbd", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2220bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2220:l00000bcb", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)]), 32)) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l00000a5c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000c28", condition()) - ) - ) - Block("1956:l00000c28", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1976:l00000a5c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l00000c3b", condition()) - ) - ) - Block("1976:l00000a5c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l00000c3b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local/gcc/malloc_with_local-before-analysis.il.expected b/src/test/correct/malloc_with_local/gcc/malloc_with_local-before-analysis.il.expected deleted file mode 100644 index 257eb9872..000000000 --- a/src/test/correct/malloc_with_local/gcc/malloc_with_local-before-analysis.il.expected +++ /dev/null @@ -1,399 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("2044:l0000031d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l0000045d", condition()) - ) - ) - Block("2008:l0000045d", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("2032:l0000046b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000484", condition()) - ) - ) - Block("2020:l00000484", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l0000046b", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000477", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l0000031d", condition()) - ) - ) - Block("2044:l0000031d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2224:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2224:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l0000067d", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l00000247", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l00000732", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1860:l0000025d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l000004d4", condition()) - ) - ) - Block("1860:l0000025d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l000004d4", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l000002a2", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l000004b6", condition()) - ) - ) - Block("1896:l000004b6", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1916:l000002a2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l000004c9", condition()) - ) - ) - Block("1916:l000002a2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l000004c9", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2084bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2084:l0000036f", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2096bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2096:l00000383", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 40bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 10bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R1, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R1, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2256bv64)) - LocalAssign(Register(R30, bv64) := 2156bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2156:l000003e7", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2280bv64)) - LocalAssign(Register(R30, bv64) := 2180bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2180:l0000040d", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2296bv64)) - LocalAssign(Register(R30, bv64) := 2196bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2196:l00000426", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R30, bv64) := 2204bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2204:l00000435", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 2212bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2212:l00000443", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l000002de", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000498", condition()) - ) - ) - Block("1956:l00000498", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1976:l000002de", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l000004ab", condition()) - ) - ) - Block("1976:l000002de", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l000004ab", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local/gcc_O2/malloc_with_local-before-analysis.il.expected b/src/test/correct/malloc_with_local/gcc_O2/malloc_with_local-before-analysis.il.expected deleted file mode 100644 index 15b26198b..000000000 --- a/src/test/correct/malloc_with_local/gcc_O2/malloc_with_local-before-analysis.il.expected +++ /dev/null @@ -1,348 +0,0 @@ -Procedure("1552:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("2044:l000003a4", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l000003cd", condition()) - ) - ) - Block("2008:l000003cd", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("2032:l000003db", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l000003f4", condition()) - ) - ) - Block("2020:l000003f4", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1552:__cxa_finalize", condition()) - ) - ) - Block("2032:l000003db", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l000003e7", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l000003a4", condition()) - ) - ) - Block("2044:l000003a4", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1568:__printf_chk", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2068:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1472:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1488bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1488:l000005a1", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__libc_start_main", condition()) - ) - ) - Block("1840:l000002ce", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1600:abort", condition()) - ) - ) - Block("?:l0000062b", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1600:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1860:l000002e4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000444", condition()) - ) - ) - Block("1860:l000002e4", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000444", - statements( - ), - jumps( - GoTo("1584:l__gmon_start__", condition()) - ) - ) - Block("1584:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l00000329", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000426", condition()) - ) - ) - Block("1896:l00000426", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1916:l00000329", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000439", condition()) - ) - ) - Block("1916:l00000329", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000439", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1664:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1664:lmain", - statements( - LocalAssign(LocalVar(#1, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#1, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#1, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#1, bv64)) - LocalAssign(Register(R2, bv64) := 65bv64) - LocalAssign(Register(R1, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2096bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 1692bv64) - ), - jumps( - DirectCall("1568:__printf_chk", condition()) - ) - ) - Block("1692:l00000221", - statements( - LocalAssign(Register(R2, bv64) := 42bv64) - LocalAssign(Register(R1, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2120bv64)) - LocalAssign(Register(R30, bv64) := 1712bv64) - ), - jumps( - DirectCall("1568:__printf_chk", condition()) - ) - ) - Block("1712:l0000023d", - statements( - LocalAssign(Register(R2, bv64) := 10bv64) - LocalAssign(Register(R1, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2136bv64)) - LocalAssign(Register(R30, bv64) := 1732bv64) - ), - jumps( - DirectCall("1568:__printf_chk", condition()) - ) - ) - Block("1732:l00000259", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l00000365", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000408", condition()) - ) - ) - Block("1956:l00000408", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1976:l00000365", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l0000041b", condition()) - ) - ) - Block("1976:l00000365", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l0000041b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local/gcc_no_plt_no_pic/malloc_with_local-before-analysis.il.expected b/src/test/correct/malloc_with_local/gcc_no_plt_no_pic/malloc_with_local-before-analysis.il.expected deleted file mode 100644 index 9da011088..000000000 --- a/src/test/correct/malloc_with_local/gcc_no_plt_no_pic/malloc_with_local-before-analysis.il.expected +++ /dev/null @@ -1,399 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000a6e", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l00000bae", condition()) - ) - ) - Block("2008:l00000bae", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("2032:l00000bbc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000bd5", condition()) - ) - ) - Block("2020:l00000bd5", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l00000bbc", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000bc8", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000a6e", condition()) - ) - ) - Block("2044:l00000a6e", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2224:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2224:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l00000dce", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l00000998", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l00000e83", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1860:l000009ae", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000c25", condition()) - ) - ) - Block("1860:l000009ae", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000c25", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l000009f3", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000c07", condition()) - ) - ) - Block("1896:l00000c07", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1916:l000009f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000c1a", condition()) - ) - ) - Block("1916:l000009f3", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000c1a", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2084bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2084:l00000ac0", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2096bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2096:l00000ad4", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 40bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 10bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R1, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R1, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2256bv64)) - LocalAssign(Register(R30, bv64) := 2156bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2156:l00000b38", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2280bv64)) - LocalAssign(Register(R30, bv64) := 2180bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2180:l00000b5e", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2296bv64)) - LocalAssign(Register(R30, bv64) := 2196bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2196:l00000b77", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R30, bv64) := 2204bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2204:l00000b86", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 2212bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2212:l00000b94", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l00000a2f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000be9", condition()) - ) - ) - Block("1956:l00000be9", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1976:l00000a2f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l00000bfc", condition()) - ) - ) - Block("1976:l00000a2f", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l00000bfc", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local/gcc_pic/malloc_with_local-before-analysis.il.expected b/src/test/correct/malloc_with_local/gcc_pic/malloc_with_local-before-analysis.il.expected deleted file mode 100644 index 9da011088..000000000 --- a/src/test/correct/malloc_with_local/gcc_pic/malloc_with_local-before-analysis.il.expected +++ /dev/null @@ -1,399 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000a6e", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l00000bae", condition()) - ) - ) - Block("2008:l00000bae", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("2032:l00000bbc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000bd5", condition()) - ) - ) - Block("2020:l00000bd5", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l00000bbc", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000bc8", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000a6e", condition()) - ) - ) - Block("2044:l00000a6e", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2224:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2224:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l00000dce", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l00000998", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l00000e83", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1860:l000009ae", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000c25", condition()) - ) - ) - Block("1860:l000009ae", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000c25", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l000009f3", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000c07", condition()) - ) - ) - Block("1896:l00000c07", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1916:l000009f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000c1a", condition()) - ) - ) - Block("1916:l000009f3", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000c1a", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2084bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2084:l00000ac0", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2096bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2096:l00000ad4", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 40bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 10bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R1, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R1, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2256bv64)) - LocalAssign(Register(R30, bv64) := 2156bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2156:l00000b38", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2280bv64)) - LocalAssign(Register(R30, bv64) := 2180bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2180:l00000b5e", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2296bv64)) - LocalAssign(Register(R30, bv64) := 2196bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2196:l00000b77", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R30, bv64) := 2204bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2204:l00000b86", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 2212bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2212:l00000b94", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l00000a2f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000be9", condition()) - ) - ) - Block("1956:l00000be9", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1976:l00000a2f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l00000bfc", condition()) - ) - ) - Block("1976:l00000a2f", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l00000bfc", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local2/clang/malloc_with_local2-before-analysis.il.expected b/src/test/correct/malloc_with_local2/clang/malloc_with_local2-before-analysis.il.expected deleted file mode 100644 index 66493eca9..000000000 --- a/src/test/correct/malloc_with_local2/clang/malloc_with_local2-before-analysis.il.expected +++ /dev/null @@ -1,417 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) - ), - jumps( - GoTo("2044:l0000034d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l000004dd", condition()) - ) - ) - Block("2008:l000004dd", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("2032:l000004eb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000504", condition()) - ) - ) - Block("2020:l00000504", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l000004eb", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l000004f7", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l0000034d", condition()) - ) - ) - Block("2044:l0000034d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2272:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2272:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l000006fd", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l00000277", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l000007be", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1860:l0000028d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000554", condition()) - ) - ) - Block("1860:l0000028d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000554", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l000002d2", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000536", condition()) - ) - ) - Block("1896:l00000536", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1916:l000002d2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000549", condition()) - ) - ) - Block("1916:l000002d2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000549", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551536bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - LocalAssign(Register(R8, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2100bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2100:l000003b5", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)] := Register(R0, bv64))) - LocalAssign(Register(R8, bv64) := 11bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551596bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 4bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R0, bv64))) - LocalAssign(Register(R30, bv64) := 2124bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2124:l000003de", - statements( - LocalAssign(Register(R8, bv64) := Register(R0, bv64)) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Register(R8, bv64))) - LocalAssign(Register(R8, bv64) := 10bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 2148bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2148:l00000407", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) - LocalAssign(Register(R8, bv64) := 9bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) - LocalAssign(Register(R8, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R8, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2296bv64)) - LocalAssign(Register(R30, bv64) := 2204bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2204:l00000465", - statements( - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2313bv64)) - LocalAssign(Register(R30, bv64) := 2224bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2224:l00000485", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2329bv64)) - LocalAssign(Register(R30, bv64) := 2240bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2240:l0000049e", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) - LocalAssign(Register(R30, bv64) := 2248bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2248:l000004ad", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R30, bv64) := 2256bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2256:l000004bb", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 80bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l0000030e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000518", condition()) - ) - ) - Block("1956:l00000518", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1976:l0000030e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l0000052b", condition()) - ) - ) - Block("1976:l0000030e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l0000052b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local2/clang_O2/malloc_with_local2-before-analysis.il.expected b/src/test/correct/malloc_with_local2/clang_O2/malloc_with_local2-before-analysis.il.expected deleted file mode 100644 index 425e44c2f..000000000 --- a/src/test/correct/malloc_with_local2/clang_O2/malloc_with_local2-before-analysis.il.expected +++ /dev/null @@ -1,345 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000036a", condition()) - ) - ) - Block("1816:l0000036a", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1840:l00000378", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000391", condition()) - ) - ) - Block("1828:l00000391", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000378", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000384", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002c5", condition()) - ) - ) - Block("1852:l000002c5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1944:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1464:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1480bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1480:l0000059b", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001ef", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l00000632", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003e1", condition()) - ) - ) - Block("1668:l00000205", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003e1", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003c3", condition()) - ) - ) - Block("1704:l000003c3", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003d6", condition()) - ) - ) - Block("1724:l0000024a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003d6", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1968bv64)) - LocalAssign(Register(R1, bv64) := 65bv64) - LocalAssign(Register(R30, bv64) := 1900bv64) - ), - jumps( - DirectCall("1584:printf", condition()) - ) - ) - Block("1900:l00000322", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1985bv64)) - LocalAssign(Register(R1, bv64) := 42bv64) - LocalAssign(Register(R30, bv64) := 1916bv64) - ), - jumps( - DirectCall("1584:printf", condition()) - ) - ) - Block("1916:l00000339", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2001bv64)) - LocalAssign(Register(R1, bv64) := 10bv64) - LocalAssign(Register(R30, bv64) := 1932bv64) - ), - jumps( - DirectCall("1584:printf", condition()) - ) - ) - Block("1932:l00000350", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1584:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003a5", condition()) - ) - ) - Block("1764:l000003a5", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003b8", condition()) - ) - ) - Block("1784:l00000286", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003b8", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local2/clang_no_plt_no_pic/malloc_with_local2-before-analysis.il.expected b/src/test/correct/malloc_with_local2/clang_no_plt_no_pic/malloc_with_local2-before-analysis.il.expected deleted file mode 100644 index f6024c5e8..000000000 --- a/src/test/correct/malloc_with_local2/clang_no_plt_no_pic/malloc_with_local2-before-analysis.il.expected +++ /dev/null @@ -1,417 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000b2a", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l00000cba", condition()) - ) - ) - Block("2008:l00000cba", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("2032:l00000cc8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000ce1", condition()) - ) - ) - Block("2020:l00000ce1", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l00000cc8", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000cd4", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000b2a", condition()) - ) - ) - Block("2044:l00000b2a", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2272:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2272:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l00000eda", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l00000a54", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l00000f9b", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1860:l00000a6a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000d31", condition()) - ) - ) - Block("1860:l00000a6a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000d31", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l00000aaf", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000d13", condition()) - ) - ) - Block("1896:l00000d13", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1916:l00000aaf", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000d26", condition()) - ) - ) - Block("1916:l00000aaf", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000d26", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551536bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - LocalAssign(Register(R8, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2100bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2100:l00000b92", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)] := Register(R0, bv64))) - LocalAssign(Register(R8, bv64) := 11bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551596bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 4bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R0, bv64))) - LocalAssign(Register(R30, bv64) := 2124bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2124:l00000bbb", - statements( - LocalAssign(Register(R8, bv64) := Register(R0, bv64)) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Register(R8, bv64))) - LocalAssign(Register(R8, bv64) := 10bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 2148bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2148:l00000be4", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) - LocalAssign(Register(R8, bv64) := 9bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) - LocalAssign(Register(R8, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R8, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2296bv64)) - LocalAssign(Register(R30, bv64) := 2204bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2204:l00000c42", - statements( - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2313bv64)) - LocalAssign(Register(R30, bv64) := 2224bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2224:l00000c62", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2329bv64)) - LocalAssign(Register(R30, bv64) := 2240bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2240:l00000c7b", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) - LocalAssign(Register(R30, bv64) := 2248bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2248:l00000c8a", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R30, bv64) := 2256bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2256:l00000c98", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 80bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l00000aeb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000cf5", condition()) - ) - ) - Block("1956:l00000cf5", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1976:l00000aeb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l00000d08", condition()) - ) - ) - Block("1976:l00000aeb", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l00000d08", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local2/clang_pic/malloc_with_local2-before-analysis.il.expected b/src/test/correct/malloc_with_local2/clang_pic/malloc_with_local2-before-analysis.il.expected deleted file mode 100644 index f6024c5e8..000000000 --- a/src/test/correct/malloc_with_local2/clang_pic/malloc_with_local2-before-analysis.il.expected +++ /dev/null @@ -1,417 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000b2a", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l00000cba", condition()) - ) - ) - Block("2008:l00000cba", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("2032:l00000cc8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000ce1", condition()) - ) - ) - Block("2020:l00000ce1", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l00000cc8", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000cd4", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000b2a", condition()) - ) - ) - Block("2044:l00000b2a", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2272:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2272:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l00000eda", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l00000a54", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l00000f9b", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1860:l00000a6a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000d31", condition()) - ) - ) - Block("1860:l00000a6a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000d31", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l00000aaf", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000d13", condition()) - ) - ) - Block("1896:l00000d13", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1916:l00000aaf", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000d26", condition()) - ) - ) - Block("1916:l00000aaf", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000d26", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551536bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - LocalAssign(Register(R8, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2100bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2100:l00000b92", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)] := Register(R0, bv64))) - LocalAssign(Register(R8, bv64) := 11bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551596bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 4bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R0, bv64))) - LocalAssign(Register(R30, bv64) := 2124bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2124:l00000bbb", - statements( - LocalAssign(Register(R8, bv64) := Register(R0, bv64)) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Register(R8, bv64))) - LocalAssign(Register(R8, bv64) := 10bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 2148bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2148:l00000be4", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) - LocalAssign(Register(R8, bv64) := 9bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) - LocalAssign(Register(R8, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R8, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2296bv64)) - LocalAssign(Register(R30, bv64) := 2204bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2204:l00000c42", - statements( - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2313bv64)) - LocalAssign(Register(R30, bv64) := 2224bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2224:l00000c62", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2329bv64)) - LocalAssign(Register(R30, bv64) := 2240bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2240:l00000c7b", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) - LocalAssign(Register(R30, bv64) := 2248bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2248:l00000c8a", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R30, bv64) := 2256bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2256:l00000c98", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 80bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l00000aeb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000cf5", condition()) - ) - ) - Block("1956:l00000cf5", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1976:l00000aeb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l00000d08", condition()) - ) - ) - Block("1976:l00000aeb", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l00000d08", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local2/gcc/malloc_with_local2-before-analysis.il.expected b/src/test/correct/malloc_with_local2/gcc/malloc_with_local2-before-analysis.il.expected deleted file mode 100644 index 8d4b8dfe7..000000000 --- a/src/test/correct/malloc_with_local2/gcc/malloc_with_local2-before-analysis.il.expected +++ /dev/null @@ -1,413 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000339", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l000004a7", condition()) - ) - ) - Block("2008:l000004a7", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("2032:l000004b5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l000004ce", condition()) - ) - ) - Block("2020:l000004ce", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l000004b5", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l000004c1", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000339", condition()) - ) - ) - Block("2044:l00000339", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2252:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2252:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l000006c7", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l00000263", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l00000783", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1860:l00000279", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l0000051e", condition()) - ) - ) - Block("1860:l00000279", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l0000051e", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000500", condition()) - ) - ) - Block("1896:l00000500", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1916:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000513", condition()) - ) - ) - Block("1916:l000002be", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000513", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551552bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2084bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2084:l0000038b", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 40bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 11bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2104bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2104:l000003ac", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 48bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 10bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2124bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2124:l000003cd", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 56bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 9bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 36bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R1, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) - LocalAssign(Register(R1, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2280bv64)) - LocalAssign(Register(R30, bv64) := 2184bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2184:l00000431", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2304bv64)) - LocalAssign(Register(R30, bv64) := 2208bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2208:l00000457", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2320bv64)) - LocalAssign(Register(R30, bv64) := 2224bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2224:l00000470", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 2232bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2232:l0000047f", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) - LocalAssign(Register(R30, bv64) := 2240bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2240:l0000048d", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l000002fa", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l000004e2", condition()) - ) - ) - Block("1956:l000004e2", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1976:l000002fa", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l000004f5", condition()) - ) - ) - Block("1976:l000002fa", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l000004f5", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local2/gcc_O2/malloc_with_local2-before-analysis.il.expected b/src/test/correct/malloc_with_local2/gcc_O2/malloc_with_local2-before-analysis.il.expected deleted file mode 100644 index 15b26198b..000000000 --- a/src/test/correct/malloc_with_local2/gcc_O2/malloc_with_local2-before-analysis.il.expected +++ /dev/null @@ -1,348 +0,0 @@ -Procedure("1552:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("2044:l000003a4", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l000003cd", condition()) - ) - ) - Block("2008:l000003cd", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("2032:l000003db", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l000003f4", condition()) - ) - ) - Block("2020:l000003f4", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1552:__cxa_finalize", condition()) - ) - ) - Block("2032:l000003db", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l000003e7", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l000003a4", condition()) - ) - ) - Block("2044:l000003a4", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1568:__printf_chk", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2068:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1472:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1488bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1488:l000005a1", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__libc_start_main", condition()) - ) - ) - Block("1840:l000002ce", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1600:abort", condition()) - ) - ) - Block("?:l0000062b", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1600:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1860:l000002e4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000444", condition()) - ) - ) - Block("1860:l000002e4", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000444", - statements( - ), - jumps( - GoTo("1584:l__gmon_start__", condition()) - ) - ) - Block("1584:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l00000329", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000426", condition()) - ) - ) - Block("1896:l00000426", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1916:l00000329", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000439", condition()) - ) - ) - Block("1916:l00000329", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000439", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1664:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1664:lmain", - statements( - LocalAssign(LocalVar(#1, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#1, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#1, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#1, bv64)) - LocalAssign(Register(R2, bv64) := 65bv64) - LocalAssign(Register(R1, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2096bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 1692bv64) - ), - jumps( - DirectCall("1568:__printf_chk", condition()) - ) - ) - Block("1692:l00000221", - statements( - LocalAssign(Register(R2, bv64) := 42bv64) - LocalAssign(Register(R1, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2120bv64)) - LocalAssign(Register(R30, bv64) := 1712bv64) - ), - jumps( - DirectCall("1568:__printf_chk", condition()) - ) - ) - Block("1712:l0000023d", - statements( - LocalAssign(Register(R2, bv64) := 10bv64) - LocalAssign(Register(R1, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2136bv64)) - LocalAssign(Register(R30, bv64) := 1732bv64) - ), - jumps( - DirectCall("1568:__printf_chk", condition()) - ) - ) - Block("1732:l00000259", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l00000365", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000408", condition()) - ) - ) - Block("1956:l00000408", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1976:l00000365", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l0000041b", condition()) - ) - ) - Block("1976:l00000365", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l0000041b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local2/gcc_no_plt_no_pic/malloc_with_local2-before-analysis.il.expected b/src/test/correct/malloc_with_local2/gcc_no_plt_no_pic/malloc_with_local2-before-analysis.il.expected deleted file mode 100644 index 596f8d8f9..000000000 --- a/src/test/correct/malloc_with_local2/gcc_no_plt_no_pic/malloc_with_local2-before-analysis.il.expected +++ /dev/null @@ -1,413 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000adb", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l00000c49", condition()) - ) - ) - Block("2008:l00000c49", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("2032:l00000c57", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000c70", condition()) - ) - ) - Block("2020:l00000c70", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l00000c57", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000c63", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000adb", condition()) - ) - ) - Block("2044:l00000adb", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2252:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2252:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l00000e69", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l00000a05", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l00000f25", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1860:l00000a1b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000cc0", condition()) - ) - ) - Block("1860:l00000a1b", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000cc0", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l00000a60", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000ca2", condition()) - ) - ) - Block("1896:l00000ca2", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1916:l00000a60", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000cb5", condition()) - ) - ) - Block("1916:l00000a60", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000cb5", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551552bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2084bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2084:l00000b2d", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 40bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 11bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2104bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2104:l00000b4e", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 48bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 10bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2124bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2124:l00000b6f", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 56bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 9bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 36bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R1, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) - LocalAssign(Register(R1, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2280bv64)) - LocalAssign(Register(R30, bv64) := 2184bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2184:l00000bd3", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2304bv64)) - LocalAssign(Register(R30, bv64) := 2208bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2208:l00000bf9", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2320bv64)) - LocalAssign(Register(R30, bv64) := 2224bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2224:l00000c12", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 2232bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2232:l00000c21", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) - LocalAssign(Register(R30, bv64) := 2240bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2240:l00000c2f", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l00000a9c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000c84", condition()) - ) - ) - Block("1956:l00000c84", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1976:l00000a9c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l00000c97", condition()) - ) - ) - Block("1976:l00000a9c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l00000c97", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local2/gcc_pic/malloc_with_local2-before-analysis.il.expected b/src/test/correct/malloc_with_local2/gcc_pic/malloc_with_local2-before-analysis.il.expected deleted file mode 100644 index 596f8d8f9..000000000 --- a/src/test/correct/malloc_with_local2/gcc_pic/malloc_with_local2-before-analysis.il.expected +++ /dev/null @@ -1,413 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000adb", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l00000c49", condition()) - ) - ) - Block("2008:l00000c49", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("2032:l00000c57", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000c70", condition()) - ) - ) - Block("2020:l00000c70", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l00000c57", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000c63", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000adb", condition()) - ) - ) - Block("2044:l00000adb", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2252:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2252:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l00000e69", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l00000a05", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l00000f25", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1860:l00000a1b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000cc0", condition()) - ) - ) - Block("1860:l00000a1b", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000cc0", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l00000a60", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000ca2", condition()) - ) - ) - Block("1896:l00000ca2", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1916:l00000a60", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000cb5", condition()) - ) - ) - Block("1916:l00000a60", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000cb5", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551552bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2084bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2084:l00000b2d", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 40bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 11bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2104bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2104:l00000b4e", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 48bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 10bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2124bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2124:l00000b6f", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 56bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 9bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 36bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R1, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) - LocalAssign(Register(R1, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2280bv64)) - LocalAssign(Register(R30, bv64) := 2184bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2184:l00000bd3", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2304bv64)) - LocalAssign(Register(R30, bv64) := 2208bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2208:l00000bf9", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2320bv64)) - LocalAssign(Register(R30, bv64) := 2224bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2224:l00000c12", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 2232bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2232:l00000c21", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) - LocalAssign(Register(R30, bv64) := 2240bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2240:l00000c2f", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l00000a9c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000c84", condition()) - ) - ) - Block("1956:l00000c84", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1976:l00000a9c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l00000c97", condition()) - ) - ) - Block("1976:l00000a9c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l00000c97", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local3/clang/malloc_with_local3-before-analysis.il.expected b/src/test/correct/malloc_with_local3/clang/malloc_with_local3-before-analysis.il.expected deleted file mode 100644 index c5432b8cd..000000000 --- a/src/test/correct/malloc_with_local3/clang/malloc_with_local3-before-analysis.il.expected +++ /dev/null @@ -1,449 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000381", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l0000057c", condition()) - ) - ) - Block("2008:l0000057c", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("2032:l0000058a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l000005a3", condition()) - ) - ) - Block("2020:l000005a3", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l0000058a", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000596", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000381", condition()) - ) - ) - Block("2044:l00000381", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2324:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2324:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#9, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#9, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#9, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#9, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l0000079c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l000002ab", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l0000086a", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1860:l000002c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l000005f3", condition()) - ) - ) - Block("1860:l000002c1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l000005f3", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l00000306", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l000005d5", condition()) - ) - ) - Block("1896:l000005d5", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1916:l00000306", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l000005e8", condition()) - ) - ) - Block("1916:l00000306", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l000005e8", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551536bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - LocalAssign(Register(R8, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2100bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2100:l000003e9", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)] := Register(R0, bv64))) - LocalAssign(Register(R8, bv64) := 11bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551596bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 4bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R0, bv64))) - LocalAssign(Register(R30, bv64) := 2124bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2124:l00000412", - statements( - LocalAssign(Register(R8, bv64) := Register(R0, bv64)) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Register(R8, bv64))) - LocalAssign(Register(R8, bv64) := 10bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 2148bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2148:l0000043b", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) - LocalAssign(Register(R8, bv64) := 9bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) - LocalAssign(Register(R8, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R8, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) - LocalAssign(Register(R30, bv64) := 2192bv64) - ), - jumps( - DirectCall("2260:printCharValue", condition()) - ) - ) - Block("2192:l00000504", - statements( - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2348bv64)) - LocalAssign(Register(R30, bv64) := 2212bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2212:l00000524", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2364bv64)) - LocalAssign(Register(R30, bv64) := 2228bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2228:l0000053d", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) - LocalAssign(Register(R30, bv64) := 2236bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2236:l0000054c", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R30, bv64) := 2244bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2244:l0000055a", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#7, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#7, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 80bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2260:printCharValue", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2260:lprintCharValue", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R9, bv64)]), 56)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2391bv64)) - LocalAssign(Register(R30, bv64) := 2312bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2312:l000004e9", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#6, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#6, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l00000342", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l000005b7", condition()) - ) - ) - Block("1956:l000005b7", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1976:l00000342", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l000005ca", condition()) - ) - ) - Block("1976:l00000342", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l000005ca", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local3/clang_O2/malloc_with_local3-before-analysis.il.expected b/src/test/correct/malloc_with_local3/clang_O2/malloc_with_local3-before-analysis.il.expected deleted file mode 100644 index 0a18ea07a..000000000 --- a/src/test/correct/malloc_with_local3/clang_O2/malloc_with_local3-before-analysis.il.expected +++ /dev/null @@ -1,361 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002e5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000003ba", condition()) - ) - ) - Block("1816:l000003ba", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1840:l000003c8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l000003e1", condition()) - ) - ) - Block("1828:l000003e1", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l000003c8", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000003d4", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002e5", condition()) - ) - ) - Block("1852:l000002e5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1976:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1976:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1464:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1480bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1480:l000005f3", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l0000020f", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l00000692", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l00000225", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000431", condition()) - ) - ) - Block("1668:l00000225", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000431", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000026a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000413", condition()) - ) - ) - Block("1704:l00000413", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1724:l0000026a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000426", condition()) - ) - ) - Block("1724:l0000026a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000426", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2043bv64)) - LocalAssign(Register(R1, bv64) := 66bv64) - LocalAssign(Register(R30, bv64) := 1900bv64) - ), - jumps( - DirectCall("1584:printf", condition()) - ) - ) - Block("1900:l00000342", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2000bv64)) - LocalAssign(Register(R1, bv64) := 42bv64) - LocalAssign(Register(R30, bv64) := 1916bv64) - ), - jumps( - DirectCall("1584:printf", condition()) - ) - ) - Block("1916:l00000359", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2016bv64)) - LocalAssign(Register(R1, bv64) := 10bv64) - LocalAssign(Register(R30, bv64) := 1932bv64) - ), - jumps( - DirectCall("1584:printf", condition()) - ) - ) - Block("1932:l00000370", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1944:printCharValue", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1944:lprintCharValue", - statements( - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - LocalAssign(Register(R8, bv64) := Register(R0, bv64)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2043bv64)) - LocalAssign(Register(R9, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R9, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("++", 0bv24, Extract(Register(R9, bv64)[8:0])), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R9, bv64)[8:0]))) - ), - jumps( - DirectCall("1584:printf", condition()) - ) - ) -)), -Procedure("1584:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002a6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003f5", condition()) - ) - ) - Block("1764:l000003f5", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l000002a6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000408", condition()) - ) - ) - Block("1784:l000002a6", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000408", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local3/clang_no_plt_no_pic/malloc_with_local3-before-analysis.il.expected b/src/test/correct/malloc_with_local3/clang_no_plt_no_pic/malloc_with_local3-before-analysis.il.expected deleted file mode 100644 index 93aaab4fc..000000000 --- a/src/test/correct/malloc_with_local3/clang_no_plt_no_pic/malloc_with_local3-before-analysis.il.expected +++ /dev/null @@ -1,449 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000c0c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l00000e07", condition()) - ) - ) - Block("2008:l00000e07", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("2032:l00000e15", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000e2e", condition()) - ) - ) - Block("2020:l00000e2e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l00000e15", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000e21", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000c0c", condition()) - ) - ) - Block("2044:l00000c0c", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2324:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2324:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#9, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#9, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#9, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#9, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l00001027", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l00000b36", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l000010f5", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1860:l00000b4c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000e7e", condition()) - ) - ) - Block("1860:l00000b4c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000e7e", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l00000b91", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000e60", condition()) - ) - ) - Block("1896:l00000e60", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1916:l00000b91", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000e73", condition()) - ) - ) - Block("1916:l00000b91", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000e73", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551536bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - LocalAssign(Register(R8, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2100bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2100:l00000c74", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)] := Register(R0, bv64))) - LocalAssign(Register(R8, bv64) := 11bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551596bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 4bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R0, bv64))) - LocalAssign(Register(R30, bv64) := 2124bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2124:l00000c9d", - statements( - LocalAssign(Register(R8, bv64) := Register(R0, bv64)) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Register(R8, bv64))) - LocalAssign(Register(R8, bv64) := 10bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 2148bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2148:l00000cc6", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) - LocalAssign(Register(R8, bv64) := 9bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) - LocalAssign(Register(R8, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R8, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) - LocalAssign(Register(R30, bv64) := 2192bv64) - ), - jumps( - DirectCall("2260:printCharValue", condition()) - ) - ) - Block("2192:l00000d8f", - statements( - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2348bv64)) - LocalAssign(Register(R30, bv64) := 2212bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2212:l00000daf", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2364bv64)) - LocalAssign(Register(R30, bv64) := 2228bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2228:l00000dc8", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) - LocalAssign(Register(R30, bv64) := 2236bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2236:l00000dd7", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R30, bv64) := 2244bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2244:l00000de5", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#7, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#7, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 80bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2260:printCharValue", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2260:lprintCharValue", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R9, bv64)]), 56)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2391bv64)) - LocalAssign(Register(R30, bv64) := 2312bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2312:l00000d74", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#6, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#6, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l00000bcd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000e42", condition()) - ) - ) - Block("1956:l00000e42", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1976:l00000bcd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l00000e55", condition()) - ) - ) - Block("1976:l00000bcd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l00000e55", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local3/clang_pic/malloc_with_local3-before-analysis.il.expected b/src/test/correct/malloc_with_local3/clang_pic/malloc_with_local3-before-analysis.il.expected deleted file mode 100644 index 93aaab4fc..000000000 --- a/src/test/correct/malloc_with_local3/clang_pic/malloc_with_local3-before-analysis.il.expected +++ /dev/null @@ -1,449 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000c0c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l00000e07", condition()) - ) - ) - Block("2008:l00000e07", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("2032:l00000e15", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000e2e", condition()) - ) - ) - Block("2020:l00000e2e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l00000e15", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000e21", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000c0c", condition()) - ) - ) - Block("2044:l00000c0c", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2324:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2324:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#9, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#9, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#9, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#9, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l00001027", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l00000b36", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l000010f5", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1860:l00000b4c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000e7e", condition()) - ) - ) - Block("1860:l00000b4c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000e7e", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l00000b91", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000e60", condition()) - ) - ) - Block("1896:l00000e60", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1916:l00000b91", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000e73", condition()) - ) - ) - Block("1916:l00000b91", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000e73", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551536bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - LocalAssign(Register(R8, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2100bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2100:l00000c74", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)] := Register(R0, bv64))) - LocalAssign(Register(R8, bv64) := 11bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551596bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 4bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R31, bv64)] := Register(R0, bv64))) - LocalAssign(Register(R30, bv64) := 2124bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2124:l00000c9d", - statements( - LocalAssign(Register(R8, bv64) := Register(R0, bv64)) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Register(R8, bv64))) - LocalAssign(Register(R8, bv64) := 10bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R30, bv64) := 2148bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2148:l00000cc6", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) - LocalAssign(Register(R8, bv64) := 9bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) - LocalAssign(Register(R8, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R8, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) - LocalAssign(Register(R30, bv64) := 2192bv64) - ), - jumps( - DirectCall("2260:printCharValue", condition()) - ) - ) - Block("2192:l00000d8f", - statements( - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2348bv64)) - LocalAssign(Register(R30, bv64) := 2212bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2212:l00000daf", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2364bv64)) - LocalAssign(Register(R30, bv64) := 2228bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2228:l00000dc8", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R29, bv64), 18446744073709551600bv64)])) - LocalAssign(Register(R30, bv64) := 2236bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2236:l00000dd7", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)])) - LocalAssign(Register(R30, bv64) := 2244bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2244:l00000de5", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#7, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#7, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 80bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2260:printCharValue", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2260:lprintCharValue", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R9, bv64)]), 56)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2391bv64)) - LocalAssign(Register(R30, bv64) := 2312bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2312:l00000d74", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#6, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#6, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l00000bcd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000e42", condition()) - ) - ) - Block("1956:l00000e42", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1976:l00000bcd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l00000e55", condition()) - ) - ) - Block("1976:l00000bcd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l00000e55", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local3/gcc/malloc_with_local3-before-analysis.il.expected b/src/test/correct/malloc_with_local3/gcc/malloc_with_local3-before-analysis.il.expected deleted file mode 100644 index 22a6a3c0f..000000000 --- a/src/test/correct/malloc_with_local3/gcc/malloc_with_local3-before-analysis.il.expected +++ /dev/null @@ -1,446 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000371", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l00000551", condition()) - ) - ) - Block("2008:l00000551", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("2032:l0000055f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000578", condition()) - ) - ) - Block("2020:l00000578", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l0000055f", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l0000056b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000371", condition()) - ) - ) - Block("2044:l00000371", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2308:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2308:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l00000771", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l0000029b", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l0000083b", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1860:l000002b1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l000005c8", condition()) - ) - ) - Block("1860:l000002b1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l000005c8", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l000002f6", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l000005aa", condition()) - ) - ) - Block("1896:l000005aa", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1916:l000002f6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l000005bd", condition()) - ) - ) - Block("1916:l000002f6", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l000005bd", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551552bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2084bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2084:l000003c3", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 40bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 11bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2104bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2104:l000003e4", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 48bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 10bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2124bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2124:l00000405", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 56bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 9bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 36bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R1, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) - LocalAssign(Register(R1, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 2168bv64) - ), - jumps( - DirectCall("2236:printCharValue", condition()) - ) - ) - Block("2168:l000004db", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2336bv64)) - LocalAssign(Register(R30, bv64) := 2192bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2192:l00000501", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2352bv64)) - LocalAssign(Register(R30, bv64) := 2208bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2208:l0000051a", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 2216bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2216:l00000529", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) - LocalAssign(Register(R30, bv64) := 2224bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2224:l00000537", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2236:printCharValue", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2236:lprintCharValue", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("++", 0bv24, Extract(Register(R0, bv64)[8:0])), 32)) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2384bv64)) - LocalAssign(Register(R30, bv64) := 2296bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2296:l000004c4", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l00000332", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l0000058c", condition()) - ) - ) - Block("1956:l0000058c", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1976:l00000332", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l0000059f", condition()) - ) - ) - Block("1976:l00000332", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l0000059f", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local3/gcc_O2/malloc_with_local3-before-analysis.il.expected b/src/test/correct/malloc_with_local3/gcc_O2/malloc_with_local3-before-analysis.il.expected deleted file mode 100644 index 7db80fa42..000000000 --- a/src/test/correct/malloc_with_local3/gcc_O2/malloc_with_local3-before-analysis.il.expected +++ /dev/null @@ -1,388 +0,0 @@ -Procedure("1664:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2112:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2112:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("2172:l00000428", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2136:l00000457", condition()) - ) - ) - Block("2136:l00000457", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("2160:l00000465", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2148:l0000047e", condition()) - ) - ) - Block("2148:l0000047e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2160bv64) - ), - jumps( - DirectCall("1664:__cxa_finalize", condition()) - ) - ) - Block("2160:l00000465", - statements( - LocalAssign(Register(R30, bv64) := 2164bv64) - ), - jumps( - DirectCall("2000:deregister_tm_clones", condition()) - ) - ) - Block("2164:l00000471", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2172:l00000428", condition()) - ) - ) - Block("2172:l00000428", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1648:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1648:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1696:__printf_chk", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2244:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2244:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1584:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1584:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1600bv64) - ), - jumps( - DirectCall("1972:call_weak_fn", condition()) - ) - ) - Block("1600:l00000677", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1920:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1968bv64) - ), - jumps( - DirectCall("1648:__libc_start_main", condition()) - ) - ) - Block("1968:l00000352", - statements( - LocalAssign(Register(R30, bv64) := 1972bv64) - ), - jumps( - DirectCall("1728:abort", condition()) - ) - ) - Block("?:l0000070d", - statements( - ), - jumps( - DirectCall("1972:call_weak_fn", condition()) - ) - ) -)), -Procedure("1728:abort", in(), out(), blocks( -)), -Procedure("1972:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1972:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1988:l00000368", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1984:l000004ce", condition()) - ) - ) - Block("1988:l00000368", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1984:l000004ce", - statements( - ), - jumps( - GoTo("1712:l__gmon_start__", condition()) - ) - ) - Block("1712:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2000:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2000:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("2044:l000003ad", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("2024:l000004b0", condition()) - ) - ) - Block("2024:l000004b0", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("2044:l000003ad", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("2036:l000004c3", condition()) - ) - ) - Block("2044:l000003ad", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("2036:l000004c3", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2192:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2192:lframe_dummy", - statements( - ), - jumps( - DirectCall("2048:register_tm_clones", condition()) - ) - ) -)), -Procedure("1744:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1792:lmain", - statements( - LocalAssign(LocalVar(#1, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#1, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#1, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#1, bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R30, bv64) := 1812bv64) - ), - jumps( - DirectCall("1680:malloc", condition()) - ) - ) - Block("1812:l00000249", - statements( - LocalAssign(Register(R1, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R19, bv64) := Register(R0, bv64)) - LocalAssign(Register(R30, bv64) := 1828bv64) - ), - jumps( - DirectCall("2208:printCharValue", condition()) - ) - ) - Block("1828:l0000029a", - statements( - LocalAssign(Register(R2, bv64) := 42bv64) - LocalAssign(Register(R1, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2296bv64)) - LocalAssign(Register(R30, bv64) := 1848bv64) - ), - jumps( - DirectCall("1696:__printf_chk", condition()) - ) - ) - Block("1848:l000002b6", - statements( - LocalAssign(Register(R1, bv64) := 0bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2312bv64)) - LocalAssign(Register(R2, bv64) := 10bv64) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 1868bv64) - ), - jumps( - DirectCall("1696:__printf_chk", condition()) - ) - ) - Block("1868:l000002d2", - statements( - LocalAssign(Register(R0, bv64) := Register(R19, bv64)) - LocalAssign(Register(R30, bv64) := 1876bv64) - ), - jumps( - DirectCall("1744:#free", condition()) - ) - ) - Block("1876:l000002e0", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1680:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2208:printCharValue", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2208:lprintCharValue", - statements( - LocalAssign(Register(R3, bv64) := Register(R0, bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R1, bv64) := 0bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2272bv64)) - LocalAssign(Register(R2, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R3, bv64)]), 56)) - LocalAssign(Register(R2, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R2, bv64)[32:0]), Extract(Register(R0, bv64)[32:0])), 32)) - LocalAssign(Register(R2, bv64) := ZeroExtend(BinaryExpr("++", 0bv24, Extract(Register(R2, bv64)[8:0])), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R3, bv64)] := Extract(Register(R2, bv64)[8:0]))) - ), - jumps( - DirectCall("1696:__printf_chk", condition()) - ) - ) -)), -Procedure("2048:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2048:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("2104:l000003e9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("2084:l00000492", condition()) - ) - ) - Block("2084:l00000492", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("2104:l000003e9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("2096:l000004a5", condition()) - ) - ) - Block("2104:l000003e9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("2096:l000004a5", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local3/gcc_no_plt_no_pic/malloc_with_local3-before-analysis.il.expected b/src/test/correct/malloc_with_local3/gcc_no_plt_no_pic/malloc_with_local3-before-analysis.il.expected deleted file mode 100644 index 770b4011e..000000000 --- a/src/test/correct/malloc_with_local3/gcc_no_plt_no_pic/malloc_with_local3-before-analysis.il.expected +++ /dev/null @@ -1,446 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000bcd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l00000dad", condition()) - ) - ) - Block("2008:l00000dad", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("2032:l00000dbb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000dd4", condition()) - ) - ) - Block("2020:l00000dd4", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l00000dbb", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000dc7", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000bcd", condition()) - ) - ) - Block("2044:l00000bcd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2308:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2308:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l00000fcd", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l00000af7", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l00001097", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1860:l00000b0d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000e24", condition()) - ) - ) - Block("1860:l00000b0d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000e24", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l00000b52", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000e06", condition()) - ) - ) - Block("1896:l00000e06", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1916:l00000b52", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000e19", condition()) - ) - ) - Block("1916:l00000b52", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000e19", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551552bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2084bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2084:l00000c1f", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 40bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 11bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2104bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2104:l00000c40", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 48bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 10bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2124bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2124:l00000c61", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 56bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 9bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 36bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R1, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) - LocalAssign(Register(R1, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 2168bv64) - ), - jumps( - DirectCall("2236:printCharValue", condition()) - ) - ) - Block("2168:l00000d37", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2336bv64)) - LocalAssign(Register(R30, bv64) := 2192bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2192:l00000d5d", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2352bv64)) - LocalAssign(Register(R30, bv64) := 2208bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2208:l00000d76", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 2216bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2216:l00000d85", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) - LocalAssign(Register(R30, bv64) := 2224bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2224:l00000d93", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2236:printCharValue", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2236:lprintCharValue", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("++", 0bv24, Extract(Register(R0, bv64)[8:0])), 32)) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2384bv64)) - LocalAssign(Register(R30, bv64) := 2296bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2296:l00000d20", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l00000b8e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000de8", condition()) - ) - ) - Block("1956:l00000de8", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1976:l00000b8e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l00000dfb", condition()) - ) - ) - Block("1976:l00000b8e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l00000dfb", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/malloc_with_local3/gcc_pic/malloc_with_local3-before-analysis.il.expected b/src/test/correct/malloc_with_local3/gcc_pic/malloc_with_local3-before-analysis.il.expected deleted file mode 100644 index 770b4011e..000000000 --- a/src/test/correct/malloc_with_local3/gcc_pic/malloc_with_local3-before-analysis.il.expected +++ /dev/null @@ -1,446 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000bcd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l00000dad", condition()) - ) - ) - Block("2008:l00000dad", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("2032:l00000dbb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000dd4", condition()) - ) - ) - Block("2020:l00000dd4", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l00000dbb", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000dc7", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000bcd", condition()) - ) - ) - Block("2044:l00000bcd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2308:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2308:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l00000fcd", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l00000af7", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l00001097", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1860:l00000b0d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000e24", condition()) - ) - ) - Block("1860:l00000b0d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000e24", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l00000b52", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000e06", condition()) - ) - ) - Block("1896:l00000e06", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1916:l00000b52", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000e19", condition()) - ) - ) - Block("1916:l00000b52", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000e19", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551552bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2084bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2084:l00000c1f", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 40bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 11bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2104bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2104:l00000c40", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 48bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 10bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 32bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2124bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2124:l00000c61", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 56bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 9bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 36bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R1, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) - LocalAssign(Register(R1, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 2168bv64) - ), - jumps( - DirectCall("2236:printCharValue", condition()) - ) - ) - Block("2168:l00000d37", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2336bv64)) - LocalAssign(Register(R30, bv64) := 2192bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2192:l00000d5d", - statements( - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 32bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2352bv64)) - LocalAssign(Register(R30, bv64) := 2208bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2208:l00000d76", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 2216bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2216:l00000d85", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 48bv64)])) - LocalAssign(Register(R30, bv64) := 2224bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2224:l00000d93", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 64bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2236:printCharValue", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2236:lprintCharValue", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - LocalAssign(Register(R0, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("++", 0bv24, Extract(Register(R0, bv64)[8:0])), 32)) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2384bv64)) - LocalAssign(Register(R30, bv64) := 2296bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2296:l00000d20", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l00000b8e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000de8", condition()) - ) - ) - Block("1956:l00000de8", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1976:l00000b8e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l00000dfb", condition()) - ) - ) - Block("1976:l00000b8e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l00000dfb", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/multi_malloc/clang/multi_malloc-before-analysis.il.expected b/src/test/correct/multi_malloc/clang/multi_malloc-before-analysis.il.expected deleted file mode 100644 index 93011469c..000000000 --- a/src/test/correct/multi_malloc/clang/multi_malloc-before-analysis.il.expected +++ /dev/null @@ -1,388 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000311", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l0000043d", condition()) - ) - ) - Block("2008:l0000043d", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("2032:l0000044b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000464", condition()) - ) - ) - Block("2020:l00000464", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l0000044b", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000457", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000311", condition()) - ) - ) - Block("2044:l00000311", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2212:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2212:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l0000065d", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l0000023b", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l0000070f", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1860:l00000251", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l000004b4", condition()) - ) - ) - Block("1860:l00000251", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l000004b4", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000496", condition()) - ) - ) - Block("1896:l00000496", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1916:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l000004a9", condition()) - ) - ) - Block("1916:l00000296", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l000004a9", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - LocalAssign(Register(R8, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2100bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2100:l00000379", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2112bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2112:l0000038d", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R8, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R8, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2236bv64)) - LocalAssign(Register(R30, bv64) := 2160bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2160:l000003de", - statements( - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2253bv64)) - LocalAssign(Register(R30, bv64) := 2180bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2180:l000003fe", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R30, bv64) := 2188bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2188:l0000040d", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2196bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2196:l0000041b", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l000002d2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000478", condition()) - ) - ) - Block("1956:l00000478", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1976:l000002d2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l0000048b", condition()) - ) - ) - Block("1976:l000002d2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l0000048b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/multi_malloc/clang_O2/multi_malloc-before-analysis.il.expected b/src/test/correct/multi_malloc/clang_O2/multi_malloc-before-analysis.il.expected deleted file mode 100644 index a112bb316..000000000 --- a/src/test/correct/multi_malloc/clang_O2/multi_malloc-before-analysis.il.expected +++ /dev/null @@ -1,334 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002b5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000343", condition()) - ) - ) - Block("1816:l00000343", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1840:l00000351", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000036a", condition()) - ) - ) - Block("1828:l0000036a", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000351", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000035d", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002b5", condition()) - ) - ) - Block("1852:l000002b5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1928:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1928:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1464:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1480bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1480:l00000570", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001df", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l00000603", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l000001f5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003ba", condition()) - ) - ) - Block("1668:l000001f5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003ba", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000023a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000039c", condition()) - ) - ) - Block("1704:l0000039c", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1724:l0000023a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003af", condition()) - ) - ) - Block("1724:l0000023a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003af", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1952bv64)) - LocalAssign(Register(R1, bv64) := 65bv64) - LocalAssign(Register(R30, bv64) := 1900bv64) - ), - jumps( - DirectCall("1584:printf", condition()) - ) - ) - Block("1900:l00000312", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 1969bv64)) - LocalAssign(Register(R1, bv64) := 42bv64) - LocalAssign(Register(R30, bv64) := 1916bv64) - ), - jumps( - DirectCall("1584:printf", condition()) - ) - ) - Block("1916:l00000329", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1584:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000037e", condition()) - ) - ) - Block("1764:l0000037e", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000391", condition()) - ) - ) - Block("1784:l00000276", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000391", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/multi_malloc/clang_no_plt_no_pic/multi_malloc-before-analysis.il.expected b/src/test/correct/multi_malloc/clang_no_plt_no_pic/multi_malloc-before-analysis.il.expected deleted file mode 100644 index 34e6c6a08..000000000 --- a/src/test/correct/multi_malloc/clang_no_plt_no_pic/multi_malloc-before-analysis.il.expected +++ /dev/null @@ -1,388 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000a3f", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l00000b6b", condition()) - ) - ) - Block("2008:l00000b6b", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("2032:l00000b79", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000b92", condition()) - ) - ) - Block("2020:l00000b92", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l00000b79", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000b85", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000a3f", condition()) - ) - ) - Block("2044:l00000a3f", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2212:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2212:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l00000d8b", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l00000969", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l00000e3d", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1860:l0000097f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000be2", condition()) - ) - ) - Block("1860:l0000097f", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000be2", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l000009c4", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000bc4", condition()) - ) - ) - Block("1896:l00000bc4", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1916:l000009c4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000bd7", condition()) - ) - ) - Block("1916:l000009c4", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000bd7", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - LocalAssign(Register(R8, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2100bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2100:l00000aa7", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2112bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2112:l00000abb", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R8, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R8, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2236bv64)) - LocalAssign(Register(R30, bv64) := 2160bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2160:l00000b0c", - statements( - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2253bv64)) - LocalAssign(Register(R30, bv64) := 2180bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2180:l00000b2c", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R30, bv64) := 2188bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2188:l00000b3b", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2196bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2196:l00000b49", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l00000a00", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000ba6", condition()) - ) - ) - Block("1956:l00000ba6", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1976:l00000a00", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l00000bb9", condition()) - ) - ) - Block("1976:l00000a00", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l00000bb9", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/multi_malloc/clang_pic/multi_malloc-before-analysis.il.expected b/src/test/correct/multi_malloc/clang_pic/multi_malloc-before-analysis.il.expected deleted file mode 100644 index 34e6c6a08..000000000 --- a/src/test/correct/multi_malloc/clang_pic/multi_malloc-before-analysis.il.expected +++ /dev/null @@ -1,388 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 72bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000a3f", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l00000b6b", condition()) - ) - ) - Block("2008:l00000b6b", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("2032:l00000b79", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000b92", condition()) - ) - ) - Block("2020:l00000b92", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 64bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l00000b79", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000b85", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 72bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000a3f", condition()) - ) - ) - Block("2044:l00000a3f", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2212:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2212:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l00000d8b", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l00000969", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l00000e3d", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1860:l0000097f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000be2", condition()) - ) - ) - Block("1860:l0000097f", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000be2", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l000009c4", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000bc4", condition()) - ) - ) - Block("1896:l00000bc4", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1916:l000009c4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000bd7", condition()) - ) - ) - Block("1916:l000009c4", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000bd7", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - LocalAssign(Register(R8, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2100bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2100:l00000aa7", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2112bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2112:l00000abb", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R8, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R8, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2236bv64)) - LocalAssign(Register(R30, bv64) := 2160bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2160:l00000b0c", - statements( - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2253bv64)) - LocalAssign(Register(R30, bv64) := 2180bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2180:l00000b2c", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R30, bv64) := 2188bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2188:l00000b3b", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2196bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2196:l00000b49", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 72bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l00000a00", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000ba6", condition()) - ) - ) - Block("1956:l00000ba6", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1976:l00000a00", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l00000bb9", condition()) - ) - ) - Block("1976:l00000a00", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l00000bb9", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/multi_malloc/gcc/multi_malloc-before-analysis.il.expected b/src/test/correct/multi_malloc/gcc/multi_malloc-before-analysis.il.expected deleted file mode 100644 index decb458cf..000000000 --- a/src/test/correct/multi_malloc/gcc/multi_malloc-before-analysis.il.expected +++ /dev/null @@ -1,386 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000305", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l0000041f", condition()) - ) - ) - Block("2008:l0000041f", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("2032:l0000042d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000446", condition()) - ) - ) - Block("2020:l00000446", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l0000042d", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000439", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000305", condition()) - ) - ) - Block("2044:l00000305", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2200:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2200:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l0000063f", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l0000022f", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l000006ee", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1860:l00000245", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000496", condition()) - ) - ) - Block("1860:l00000245", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000496", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000478", condition()) - ) - ) - Block("1896:l00000478", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1916:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l0000048b", condition()) - ) - ) - Block("1916:l0000028a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l0000048b", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2084bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2084:l00000357", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2096bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2096:l0000036b", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R1, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R1, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2232bv64)) - LocalAssign(Register(R30, bv64) := 2148bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2148:l000003c2", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2256bv64)) - LocalAssign(Register(R30, bv64) := 2172bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2172:l000003e8", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R30, bv64) := 2180bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2180:l000003f7", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R30, bv64) := 2188bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2188:l00000405", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l000002c6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l0000045a", condition()) - ) - ) - Block("1956:l0000045a", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1976:l000002c6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l0000046d", condition()) - ) - ) - Block("1976:l000002c6", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l0000046d", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/multi_malloc/gcc_O2/multi_malloc-before-analysis.il.expected b/src/test/correct/multi_malloc/gcc_O2/multi_malloc-before-analysis.il.expected deleted file mode 100644 index 1fe472897..000000000 --- a/src/test/correct/multi_malloc/gcc_O2/multi_malloc-before-analysis.il.expected +++ /dev/null @@ -1,336 +0,0 @@ -Procedure("1552:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1980:l00000332", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1944:l0000035b", condition()) - ) - ) - Block("1944:l0000035b", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1968:l00000369", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000382", condition()) - ) - ) - Block("1956:l00000382", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1968bv64) - ), - jumps( - DirectCall("1552:__cxa_finalize", condition()) - ) - ) - Block("1968:l00000369", - statements( - LocalAssign(Register(R30, bv64) := 1972bv64) - ), - jumps( - DirectCall("1808:deregister_tm_clones", condition()) - ) - ) - Block("1972:l00000375", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1980:l00000332", condition()) - ) - ) - Block("1980:l00000332", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1568:__printf_chk", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2004:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2004:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1472:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1488bv64) - ), - jumps( - DirectCall("1780:call_weak_fn", condition()) - ) - ) - Block("1488:l0000052f", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1536:__libc_start_main", condition()) - ) - ) - Block("1776:l0000025c", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1600:abort", condition()) - ) - ) - Block("?:l000005a9", - statements( - ), - jumps( - DirectCall("1780:call_weak_fn", condition()) - ) - ) -)), -Procedure("1600:abort", in(), out(), blocks( -)), -Procedure("1780:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1780:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1796:l00000272", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1792:l000003d2", condition()) - ) - ) - Block("1796:l00000272", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1792:l000003d2", - statements( - ), - jumps( - GoTo("1584:l__gmon_start__", condition()) - ) - ) - Block("1584:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1808:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1852:l000002b7", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1832:l000003b4", condition()) - ) - ) - Block("1832:l000003b4", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1852:l000002b7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1844:l000003c7", condition()) - ) - ) - Block("1852:l000002b7", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1844:l000003c7", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2000:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2000:lframe_dummy", - statements( - ), - jumps( - DirectCall("1856:register_tm_clones", condition()) - ) - ) -)), -Procedure("1664:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1664:lmain", - statements( - LocalAssign(LocalVar(#1, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#1, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#1, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#1, bv64)) - LocalAssign(Register(R2, bv64) := 65bv64) - LocalAssign(Register(R1, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2032bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 1692bv64) - ), - jumps( - DirectCall("1568:__printf_chk", condition()) - ) - ) - Block("1692:l000001e1", - statements( - LocalAssign(Register(R2, bv64) := 42bv64) - LocalAssign(Register(R1, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 2056bv64)) - LocalAssign(Register(R30, bv64) := 1712bv64) - ), - jumps( - DirectCall("1568:__printf_chk", condition()) - ) - ) - Block("1712:l000001fd", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1856:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1912:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1892:l00000396", condition()) - ) - ) - Block("1892:l00000396", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1912:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1904:l000003a9", condition()) - ) - ) - Block("1912:l000002f3", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1904:l000003a9", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/multi_malloc/gcc_no_plt_no_pic/multi_malloc-before-analysis.il.expected b/src/test/correct/multi_malloc/gcc_no_plt_no_pic/multi_malloc-before-analysis.il.expected deleted file mode 100644 index 5f65619ac..000000000 --- a/src/test/correct/multi_malloc/gcc_no_plt_no_pic/multi_malloc-before-analysis.il.expected +++ /dev/null @@ -1,386 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000a12", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l00000b2c", condition()) - ) - ) - Block("2008:l00000b2c", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("2032:l00000b3a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000b53", condition()) - ) - ) - Block("2020:l00000b53", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l00000b3a", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000b46", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000a12", condition()) - ) - ) - Block("2044:l00000a12", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2200:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2200:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l00000d4c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l0000093c", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l00000dfb", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1860:l00000952", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000ba3", condition()) - ) - ) - Block("1860:l00000952", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000ba3", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l00000997", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000b85", condition()) - ) - ) - Block("1896:l00000b85", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1916:l00000997", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000b98", condition()) - ) - ) - Block("1916:l00000997", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000b98", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2084bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2084:l00000a64", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2096bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2096:l00000a78", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R1, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R1, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2232bv64)) - LocalAssign(Register(R30, bv64) := 2148bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2148:l00000acf", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2256bv64)) - LocalAssign(Register(R30, bv64) := 2172bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2172:l00000af5", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R30, bv64) := 2180bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2180:l00000b04", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R30, bv64) := 2188bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2188:l00000b12", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l000009d3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000b67", condition()) - ) - ) - Block("1956:l00000b67", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1976:l000009d3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l00000b7a", condition()) - ) - ) - Block("1976:l000009d3", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l00000b7a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/multi_malloc/gcc_pic/multi_malloc-before-analysis.il.expected b/src/test/correct/multi_malloc/gcc_pic/multi_malloc-before-analysis.il.expected deleted file mode 100644 index 5f65619ac..000000000 --- a/src/test/correct/multi_malloc/gcc_pic/multi_malloc-before-analysis.il.expected +++ /dev/null @@ -1,386 +0,0 @@ -Procedure("1648:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1984:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1984:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("2044:l00000a12", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("2008:l00000b2c", condition()) - ) - ) - Block("2008:l00000b2c", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("2032:l00000b3a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("2020:l00000b53", condition()) - ) - ) - Block("2020:l00000b53", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 2032bv64) - ), - jumps( - DirectCall("1648:__cxa_finalize", condition()) - ) - ) - Block("2032:l00000b3a", - statements( - LocalAssign(Register(R30, bv64) := 2036bv64) - ), - jumps( - DirectCall("1872:deregister_tm_clones", condition()) - ) - ) - Block("2036:l00000b46", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("2044:l00000a12", condition()) - ) - ) - Block("2044:l00000a12", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1632:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1632:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2200:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2200:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1576:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1576:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1592bv64) - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) - Block("1592:l00000d4c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1792:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1632:__libc_start_main", condition()) - ) - ) - Block("1840:l0000093c", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1696:abort", condition()) - ) - ) - Block("?:l00000dfb", - statements( - ), - jumps( - DirectCall("1844:call_weak_fn", condition()) - ) - ) -)), -Procedure("1696:abort", in(), out(), blocks( -)), -Procedure("1844:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1860:l00000952", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1856:l00000ba3", condition()) - ) - ) - Block("1860:l00000952", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1856:l00000ba3", - statements( - ), - jumps( - GoTo("1680:l__gmon_start__", condition()) - ) - ) - Block("1680:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1916:l00000997", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l00000b85", condition()) - ) - ) - Block("1896:l00000b85", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1916:l00000997", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1908:l00000b98", condition()) - ) - ) - Block("1916:l00000997", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1908:l00000b98", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("2064:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2064:lframe_dummy", - statements( - ), - jumps( - DirectCall("1920:register_tm_clones", condition()) - ) - ) -)), -Procedure("1712:#free", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("2068:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("2068:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - LocalAssign(Register(R30, bv64) := 2084bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2084:l00000a64", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 4bv64) - LocalAssign(Register(R30, bv64) := 2096bv64) - ), - jumps( - DirectCall("1664:malloc", condition()) - ) - ) - Block("2096:l00000a78", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R1, bv64) := 65bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R1, bv64) := 42bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2232bv64)) - LocalAssign(Register(R30, bv64) := 2148bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2148:l00000acf", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(Extract(Register(R0, bv64)[32:0]), 32)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 2256bv64)) - LocalAssign(Register(R30, bv64) := 2172bv64) - ), - jumps( - DirectCall("1728:printf", condition()) - ) - ) - Block("2172:l00000af5", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R30, bv64) := 2180bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2180:l00000b04", - statements( - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)])) - LocalAssign(Register(R30, bv64) := 2188bv64) - ), - jumps( - DirectCall("1712:#free", condition()) - ) - ) - Block("2188:l00000b12", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:malloc", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:printf", in(Parameter(Register(R0, bv64))), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1920:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1920:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1976:l000009d3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1956:l00000b67", condition()) - ) - ) - Block("1956:l00000b67", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1976:l000009d3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1968:l00000b7a", condition()) - ) - ) - Block("1976:l000009d3", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1968:l00000b7a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/nestedif/clang/nestedif-before-analysis.il.expected b/src/test/correct/nestedif/clang/nestedif-before-analysis.il.expected deleted file mode 100644 index 98c938269..000000000 --- a/src/test/correct/nestedif/clang/nestedif-before-analysis.il.expected +++ /dev/null @@ -1,487 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000309", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000457", condition()) - ) - ) - Block("1752:l00000457", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000465", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000047e", condition()) - ) - ) - Block("1764:l0000047e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000465", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000471", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000309", condition()) - ) - ) - Block("1788:l00000309", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1948:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1948:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000673", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000233", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000073c", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000249", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000004ce", condition()) - ) - ) - Block("1604:l00000249", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000004ce", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000004b0", condition()) - ) - ) - Block("1640:l000004b0", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000028e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000004c3", condition()) - ) - ) - Block("1660:l0000028e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000004c3", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000379", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l0000037c", condition()) - ) - ) - Block("?:l0000037c", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l0000037f", condition()) - ) - ) - Block("?:l00000379", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l0000037f", condition()) - ) - ) - Block("?:l0000037f", - statements( - ), - jumps( - GoTo("1864:l00000387", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1848:l00000442", condition()) - ) - ) - Block("1864:l00000387", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l000003b2", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l000003b5", condition()) - ) - ) - Block("?:l000003b5", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l000003b8", condition()) - ) - ) - Block("?:l000003b2", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l000003b8", condition()) - ) - ) - Block("?:l000003b8", - statements( - ), - jumps( - GoTo("1896:l000003c0", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1880:l0000042d", condition()) - ) - ) - Block("1896:l000003c0", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967293bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934590bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967294bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l000003eb", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l000003ee", condition()) - ) - ) - Block("?:l000003ee", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l000003f1", condition()) - ) - ) - Block("?:l000003eb", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l000003f1", condition()) - ) - ) - Block("?:l000003f1", - statements( - ), - jumps( - GoTo("1928:l000003f9", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1912:l00000418", condition()) - ) - ) - Block("1912:l00000418", - statements( - ), - jumps( - GoTo("1916:l00000419", condition()) - ) - ) - Block("1916:l00000419", - statements( - LocalAssign(Register(R8, bv64) := 7bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1928:l000003f9", condition()) - ) - ) - Block("1928:l000003f9", - statements( - ), - jumps( - GoTo("1932:l000003ff", condition()) - ) - ) - Block("1880:l0000042d", - statements( - ), - jumps( - GoTo("1884:l0000042e", condition()) - ) - ) - Block("1884:l0000042e", - statements( - LocalAssign(Register(R8, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1932:l000003ff", condition()) - ) - ) - Block("1932:l000003ff", - statements( - ), - jumps( - GoTo("1936:l00000403", condition()) - ) - ) - Block("1848:l00000442", - statements( - ), - jumps( - GoTo("1852:l00000443", condition()) - ) - ) - Block("1852:l00000443", - statements( - LocalAssign(Register(R8, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1936:l00000403", condition()) - ) - ) - Block("1936:l00000403", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000002ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000492", condition()) - ) - ) - Block("1700:l00000492", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000002ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000004a5", condition()) - ) - ) - Block("1720:l000002ca", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000004a5", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/nestedif/clang_O2/nestedif-before-analysis.il.expected b/src/test/correct/nestedif/clang_O2/nestedif-before-analysis.il.expected deleted file mode 100644 index 5a5a5bf1d..000000000 --- a/src/test/correct/nestedif/clang_O2/nestedif-before-analysis.il.expected +++ /dev/null @@ -1,302 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000289", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002bc", condition()) - ) - ) - Block("1752:l000002bc", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000002e3", condition()) - ) - ) - Block("1764:l000002e3", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002ca", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002d6", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000289", condition()) - ) - ) - Block("1788:l00000289", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1820:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1820:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004b8", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001b3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000055e", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001c9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000333", condition()) - ) - ) - Block("1604:l000001c9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000333", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000020e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000315", condition()) - ) - ) - Block("1640:l00000315", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000020e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000328", condition()) - ) - ) - Block("1660:l0000020e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000328", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000002f7", condition()) - ) - ) - Block("1700:l000002f7", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000030a", condition()) - ) - ) - Block("1720:l0000024a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000030a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/nestedif/clang_no_plt_no_pic/nestedif-before-analysis.il.expected b/src/test/correct/nestedif/clang_no_plt_no_pic/nestedif-before-analysis.il.expected deleted file mode 100644 index 1415905d0..000000000 --- a/src/test/correct/nestedif/clang_no_plt_no_pic/nestedif-before-analysis.il.expected +++ /dev/null @@ -1,487 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000a3a", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000b88", condition()) - ) - ) - Block("1752:l00000b88", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000b96", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000baf", condition()) - ) - ) - Block("1764:l00000baf", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000b96", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000ba2", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000a3a", condition()) - ) - ) - Block("1788:l00000a3a", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1948:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1948:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000da4", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000964", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000e48", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000097a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000bff", condition()) - ) - ) - Block("1604:l0000097a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000bff", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000009bf", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000be1", condition()) - ) - ) - Block("1640:l00000be1", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l000009bf", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000bf4", condition()) - ) - ) - Block("1660:l000009bf", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000bf4", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000aaa", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000aad", condition()) - ) - ) - Block("?:l00000aad", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000ab0", condition()) - ) - ) - Block("?:l00000aaa", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000ab0", condition()) - ) - ) - Block("?:l00000ab0", - statements( - ), - jumps( - GoTo("1864:l00000ab8", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1848:l00000b73", condition()) - ) - ) - Block("1864:l00000ab8", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000ae3", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000ae6", condition()) - ) - ) - Block("?:l00000ae6", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000ae9", condition()) - ) - ) - Block("?:l00000ae3", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000ae9", condition()) - ) - ) - Block("?:l00000ae9", - statements( - ), - jumps( - GoTo("1896:l00000af1", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1880:l00000b5e", condition()) - ) - ) - Block("1896:l00000af1", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967293bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934590bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967294bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000b1c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000b1f", condition()) - ) - ) - Block("?:l00000b1f", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000b22", condition()) - ) - ) - Block("?:l00000b1c", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000b22", condition()) - ) - ) - Block("?:l00000b22", - statements( - ), - jumps( - GoTo("1928:l00000b2a", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1912:l00000b49", condition()) - ) - ) - Block("1912:l00000b49", - statements( - ), - jumps( - GoTo("1916:l00000b4a", condition()) - ) - ) - Block("1916:l00000b4a", - statements( - LocalAssign(Register(R8, bv64) := 7bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1928:l00000b2a", condition()) - ) - ) - Block("1928:l00000b2a", - statements( - ), - jumps( - GoTo("1932:l00000b30", condition()) - ) - ) - Block("1880:l00000b5e", - statements( - ), - jumps( - GoTo("1884:l00000b5f", condition()) - ) - ) - Block("1884:l00000b5f", - statements( - LocalAssign(Register(R8, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1932:l00000b30", condition()) - ) - ) - Block("1932:l00000b30", - statements( - ), - jumps( - GoTo("1936:l00000b34", condition()) - ) - ) - Block("1848:l00000b73", - statements( - ), - jumps( - GoTo("1852:l00000b74", condition()) - ) - ) - Block("1852:l00000b74", - statements( - LocalAssign(Register(R8, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1936:l00000b34", condition()) - ) - ) - Block("1936:l00000b34", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000009fb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000bc3", condition()) - ) - ) - Block("1700:l00000bc3", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000009fb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000bd6", condition()) - ) - ) - Block("1720:l000009fb", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000bd6", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/nestedif/clang_pic/nestedif-before-analysis.il.expected b/src/test/correct/nestedif/clang_pic/nestedif-before-analysis.il.expected deleted file mode 100644 index 1415905d0..000000000 --- a/src/test/correct/nestedif/clang_pic/nestedif-before-analysis.il.expected +++ /dev/null @@ -1,487 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000a3a", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000b88", condition()) - ) - ) - Block("1752:l00000b88", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000b96", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000baf", condition()) - ) - ) - Block("1764:l00000baf", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000b96", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000ba2", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000a3a", condition()) - ) - ) - Block("1788:l00000a3a", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1948:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1948:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000da4", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000964", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000e48", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000097a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000bff", condition()) - ) - ) - Block("1604:l0000097a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000bff", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000009bf", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000be1", condition()) - ) - ) - Block("1640:l00000be1", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l000009bf", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000bf4", condition()) - ) - ) - Block("1660:l000009bf", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000bf4", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000aaa", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000aad", condition()) - ) - ) - Block("?:l00000aad", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000ab0", condition()) - ) - ) - Block("?:l00000aaa", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000ab0", condition()) - ) - ) - Block("?:l00000ab0", - statements( - ), - jumps( - GoTo("1864:l00000ab8", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1848:l00000b73", condition()) - ) - ) - Block("1864:l00000ab8", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000ae3", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000ae6", condition()) - ) - ) - Block("?:l00000ae6", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000ae9", condition()) - ) - ) - Block("?:l00000ae3", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000ae9", condition()) - ) - ) - Block("?:l00000ae9", - statements( - ), - jumps( - GoTo("1896:l00000af1", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1880:l00000b5e", condition()) - ) - ) - Block("1896:l00000af1", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967293bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934590bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967294bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000b1c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000b1f", condition()) - ) - ) - Block("?:l00000b1f", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000b22", condition()) - ) - ) - Block("?:l00000b1c", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000b22", condition()) - ) - ) - Block("?:l00000b22", - statements( - ), - jumps( - GoTo("1928:l00000b2a", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1912:l00000b49", condition()) - ) - ) - Block("1912:l00000b49", - statements( - ), - jumps( - GoTo("1916:l00000b4a", condition()) - ) - ) - Block("1916:l00000b4a", - statements( - LocalAssign(Register(R8, bv64) := 7bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1928:l00000b2a", condition()) - ) - ) - Block("1928:l00000b2a", - statements( - ), - jumps( - GoTo("1932:l00000b30", condition()) - ) - ) - Block("1880:l00000b5e", - statements( - ), - jumps( - GoTo("1884:l00000b5f", condition()) - ) - ) - Block("1884:l00000b5f", - statements( - LocalAssign(Register(R8, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1932:l00000b30", condition()) - ) - ) - Block("1932:l00000b30", - statements( - ), - jumps( - GoTo("1936:l00000b34", condition()) - ) - ) - Block("1848:l00000b73", - statements( - ), - jumps( - GoTo("1852:l00000b74", condition()) - ) - ) - Block("1852:l00000b74", - statements( - LocalAssign(Register(R8, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1936:l00000b34", condition()) - ) - ) - Block("1936:l00000b34", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000009fb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000bc3", condition()) - ) - ) - Block("1700:l00000bc3", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000009fb", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000bd6", condition()) - ) - ) - Block("1720:l000009fb", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000bd6", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/nestedif/gcc/nestedif-before-analysis.il.expected b/src/test/correct/nestedif/gcc/nestedif-before-analysis.il.expected deleted file mode 100644 index b3988847c..000000000 --- a/src/test/correct/nestedif/gcc/nestedif-before-analysis.il.expected +++ /dev/null @@ -1,376 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002e1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000003d5", condition()) - ) - ) - Block("1752:l000003d5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000003e3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003fc", condition()) - ) - ) - Block("1764:l000003fc", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000003e3", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000003ef", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002e1", condition()) - ) - ) - Block("1788:l000002e1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1908:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1908:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000005e7", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000020b", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000006a7", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000221", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000044c", condition()) - ) - ) - Block("1604:l00000221", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000044c", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000042e", condition()) - ) - ) - Block("1640:l0000042e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000441", condition()) - ) - ) - Block("1660:l00000266", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000441", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1852:l00000345", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1840:l000003c4", condition()) - ) - ) - Block("1852:l00000345", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1876:l0000036b", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1864:l000003b3", condition()) - ) - ) - Block("1876:l0000036b", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1896:l00000391", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1888:l000003a6", condition()) - ) - ) - Block("1888:l000003a6", - statements( - LocalAssign(Register(R0, bv64) := 7bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1896:l00000391", condition()) - ) - ) - Block("1864:l000003b3", - statements( - LocalAssign(Register(R0, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1896:l00000391", condition()) - ) - ) - Block("1840:l000003c4", - statements( - LocalAssign(Register(R0, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1896:l00000391", condition()) - ) - ) - Block("1896:l00000391", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000002a2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000410", condition()) - ) - ) - Block("1700:l00000410", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000002a2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000423", condition()) - ) - ) - Block("1720:l000002a2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000423", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/nestedif/gcc_O2/nestedif-before-analysis.il.expected b/src/test/correct/nestedif/gcc_O2/nestedif-before-analysis.il.expected deleted file mode 100644 index 82dc9ebf6..000000000 --- a/src/test/correct/nestedif/gcc_O2/nestedif-before-analysis.il.expected +++ /dev/null @@ -1,302 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002e7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000310", condition()) - ) - ) - Block("1816:l00000310", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000031e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000337", condition()) - ) - ) - Block("1828:l00000337", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000031e", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000032a", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002e7", condition()) - ) - ) - Block("1852:l000002e7", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l0000051a", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000211", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005ce", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000227", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000387", condition()) - ) - ) - Block("1668:l00000227", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000387", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000026c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000369", condition()) - ) - ) - Block("1704:l00000369", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l0000026c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l0000037c", condition()) - ) - ) - Block("1724:l0000026c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l0000037c", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002a8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000034b", condition()) - ) - ) - Block("1764:l0000034b", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002a8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000035e", condition()) - ) - ) - Block("1784:l000002a8", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000035e", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/nestedif/gcc_no_plt_no_pic/nestedif-before-analysis.il.expected b/src/test/correct/nestedif/gcc_no_plt_no_pic/nestedif-before-analysis.il.expected deleted file mode 100644 index 9142faae4..000000000 --- a/src/test/correct/nestedif/gcc_no_plt_no_pic/nestedif-before-analysis.il.expected +++ /dev/null @@ -1,376 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000097d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000a71", condition()) - ) - ) - Block("1752:l00000a71", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000a7f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000a98", condition()) - ) - ) - Block("1764:l00000a98", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000a7f", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000a8b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000097d", condition()) - ) - ) - Block("1788:l0000097d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1908:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1908:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000c83", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000008a7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000d1d", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000008bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000ae8", condition()) - ) - ) - Block("1604:l000008bd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000ae8", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000902", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000aca", condition()) - ) - ) - Block("1640:l00000aca", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000902", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000add", condition()) - ) - ) - Block("1660:l00000902", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000add", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1852:l000009e1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1840:l00000a60", condition()) - ) - ) - Block("1852:l000009e1", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1876:l00000a07", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1864:l00000a4f", condition()) - ) - ) - Block("1876:l00000a07", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1896:l00000a2d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1888:l00000a42", condition()) - ) - ) - Block("1888:l00000a42", - statements( - LocalAssign(Register(R0, bv64) := 7bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1896:l00000a2d", condition()) - ) - ) - Block("1864:l00000a4f", - statements( - LocalAssign(Register(R0, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1896:l00000a2d", condition()) - ) - ) - Block("1840:l00000a60", - statements( - LocalAssign(Register(R0, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1896:l00000a2d", condition()) - ) - ) - Block("1896:l00000a2d", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000093e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000aac", condition()) - ) - ) - Block("1700:l00000aac", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000093e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000abf", condition()) - ) - ) - Block("1720:l0000093e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000abf", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/nestedif/gcc_pic/nestedif-before-analysis.il.expected b/src/test/correct/nestedif/gcc_pic/nestedif-before-analysis.il.expected deleted file mode 100644 index 9142faae4..000000000 --- a/src/test/correct/nestedif/gcc_pic/nestedif-before-analysis.il.expected +++ /dev/null @@ -1,376 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000097d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000a71", condition()) - ) - ) - Block("1752:l00000a71", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000a7f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000a98", condition()) - ) - ) - Block("1764:l00000a98", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000a7f", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000a8b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000097d", condition()) - ) - ) - Block("1788:l0000097d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1908:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1908:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000c83", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000008a7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000d1d", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000008bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000ae8", condition()) - ) - ) - Block("1604:l000008bd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000ae8", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000902", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000aca", condition()) - ) - ) - Block("1640:l00000aca", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000902", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000add", condition()) - ) - ) - Block("1660:l00000902", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000add", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1852:l000009e1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1840:l00000a60", condition()) - ) - ) - Block("1852:l000009e1", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1876:l00000a07", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1864:l00000a4f", condition()) - ) - ) - Block("1876:l00000a07", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1896:l00000a2d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1888:l00000a42", condition()) - ) - ) - Block("1888:l00000a42", - statements( - LocalAssign(Register(R0, bv64) := 7bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1896:l00000a2d", condition()) - ) - ) - Block("1864:l00000a4f", - statements( - LocalAssign(Register(R0, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1896:l00000a2d", condition()) - ) - ) - Block("1840:l00000a60", - statements( - LocalAssign(Register(R0, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1896:l00000a2d", condition()) - ) - ) - Block("1896:l00000a2d", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000093e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000aac", condition()) - ) - ) - Block("1700:l00000aac", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000093e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000abf", condition()) - ) - ) - Block("1720:l0000093e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000abf", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/no_interference_update_x/clang/no_interference_update_x-before-analysis.il.expected b/src/test/correct/no_interference_update_x/clang/no_interference_update_x-before-analysis.il.expected deleted file mode 100644 index 8a23eadb8..000000000 --- a/src/test/correct/no_interference_update_x/clang/no_interference_update_x-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002da", condition()) - ) - ) - Block("1752:l000002da", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000301", condition()) - ) - ) - Block("1764:l00000301", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002e8", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002f4", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000295", condition()) - ) - ) - Block("1788:l00000295", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1832:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004d9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001bf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000582", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000351", condition()) - ) - ) - Block("1604:l000001d5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000351", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000333", condition()) - ) - ) - Block("1640:l00000333", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000346", condition()) - ) - ) - Block("1660:l0000021a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000346", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000315", condition()) - ) - ) - Block("1700:l00000315", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000328", condition()) - ) - ) - Block("1720:l00000256", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000328", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/no_interference_update_x/clang_O2/no_interference_update_x-before-analysis.il.expected b/src/test/correct/no_interference_update_x/clang_O2/no_interference_update_x-before-analysis.il.expected deleted file mode 100644 index e47151e8a..000000000 --- a/src/test/correct/no_interference_update_x/clang_O2/no_interference_update_x-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002da", condition()) - ) - ) - Block("1752:l000002da", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000301", condition()) - ) - ) - Block("1764:l00000301", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002e8", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002f4", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000295", condition()) - ) - ) - Block("1788:l00000295", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1832:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004d9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001bf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000582", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000351", condition()) - ) - ) - Block("1604:l000001d5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000351", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000333", condition()) - ) - ) - Block("1640:l00000333", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000346", condition()) - ) - ) - Block("1660:l0000021a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000346", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 1bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000315", condition()) - ) - ) - Block("1700:l00000315", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000328", condition()) - ) - ) - Block("1720:l00000256", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000328", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/no_interference_update_x/clang_no_plt_no_pic/no_interference_update_x-before-analysis.il.expected b/src/test/correct/no_interference_update_x/clang_no_plt_no_pic/no_interference_update_x-before-analysis.il.expected deleted file mode 100644 index 37424e6b7..000000000 --- a/src/test/correct/no_interference_update_x/clang_no_plt_no_pic/no_interference_update_x-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000080c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000851", condition()) - ) - ) - Block("1752:l00000851", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000085f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000878", condition()) - ) - ) - Block("1764:l00000878", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000085f", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000086b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000080c", condition()) - ) - ) - Block("1788:l0000080c", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1832:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000a50", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000736", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000ad7", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000074c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000008c8", condition()) - ) - ) - Block("1604:l0000074c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000008c8", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000008aa", condition()) - ) - ) - Block("1640:l000008aa", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000008bd", condition()) - ) - ) - Block("1660:l00000791", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000008bd", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000088c", condition()) - ) - ) - Block("1700:l0000088c", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000089f", condition()) - ) - ) - Block("1720:l000007cd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000089f", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/no_interference_update_x/clang_pic/no_interference_update_x-before-analysis.il.expected b/src/test/correct/no_interference_update_x/clang_pic/no_interference_update_x-before-analysis.il.expected deleted file mode 100644 index bba5c8aee..000000000 --- a/src/test/correct/no_interference_update_x/clang_pic/no_interference_update_x-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000002e5", condition()) - ) - ) - Block("1816:l000002e5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) - ), - jumps( - GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000030c", condition()) - ) - ) - Block("1828:l0000030c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l000002f3", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000002ff", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l00000299", condition()) - ) - ) - Block("1852:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1900:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l00000493", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l0000053d", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000035c", condition()) - ) - ) - Block("1668:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000035c", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000033e", condition()) - ) - ) - Block("1704:l0000033e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000351", condition()) - ) - ) - Block("1724:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000351", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4040bv64)])) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000320", condition()) - ) - ) - Block("1764:l00000320", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000333", condition()) - ) - ) - Block("1784:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000333", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/no_interference_update_x/gcc/no_interference_update_x-before-analysis.il.expected b/src/test/correct/no_interference_update_x/gcc/no_interference_update_x-before-analysis.il.expected deleted file mode 100644 index 4e55ece6b..000000000 --- a/src/test/correct/no_interference_update_x/gcc/no_interference_update_x-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002e4", condition()) - ) - ) - Block("1752:l000002e4", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000002f2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000030b", condition()) - ) - ) - Block("1764:l0000030b", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002f2", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002fe", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000299", condition()) - ) - ) - Block("1788:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004e4", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000058e", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000035b", condition()) - ) - ) - Block("1604:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000035b", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000033d", condition()) - ) - ) - Block("1640:l0000033d", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000350", condition()) - ) - ) - Block("1660:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000350", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000031f", condition()) - ) - ) - Block("1700:l0000031f", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000332", condition()) - ) - ) - Block("1720:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000332", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/no_interference_update_x/gcc_O2/no_interference_update_x-before-analysis.il.expected b/src/test/correct/no_interference_update_x/gcc_O2/no_interference_update_x-before-analysis.il.expected deleted file mode 100644 index bebedbe2b..000000000 --- a/src/test/correct/no_interference_update_x/gcc_O2/no_interference_update_x-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f3", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000031c", condition()) - ) - ) - Block("1816:l0000031c", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000032a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000343", condition()) - ) - ) - Block("1828:l00000343", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000032a", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000336", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f3", condition()) - ) - ) - Block("1852:l000002f3", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l00000526", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l0000021d", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005da", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000233", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000393", condition()) - ) - ) - Block("1668:l00000233", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000393", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000375", condition()) - ) - ) - Block("1704:l00000375", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000388", condition()) - ) - ) - Block("1724:l00000278", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000388", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R2, bv64) := 1bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R2, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000357", condition()) - ) - ) - Block("1764:l00000357", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000036a", condition()) - ) - ) - Block("1784:l000002b4", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000036a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/no_interference_update_x/gcc_no_plt_no_pic/no_interference_update_x-before-analysis.il.expected b/src/test/correct/no_interference_update_x/gcc_no_plt_no_pic/no_interference_update_x-before-analysis.il.expected deleted file mode 100644 index 7f7a9b76c..000000000 --- a/src/test/correct/no_interference_update_x/gcc_no_plt_no_pic/no_interference_update_x-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000081c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000867", condition()) - ) - ) - Block("1752:l00000867", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000088e", condition()) - ) - ) - Block("1764:l0000088e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000875", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000881", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000081c", condition()) - ) - ) - Block("1788:l0000081c", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000a67", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000746", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000aef", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l0000075c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000008de", condition()) - ) - ) - Block("1604:l0000075c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000008de", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000008c0", condition()) - ) - ) - Block("1640:l000008c0", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000008d3", condition()) - ) - ) - Block("1660:l000007a1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000008d3", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000008a2", condition()) - ) - ) - Block("1700:l000008a2", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000008b5", condition()) - ) - ) - Block("1720:l000007dd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000008b5", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/no_interference_update_x/gcc_pic/no_interference_update_x-before-analysis.il.expected b/src/test/correct/no_interference_update_x/gcc_pic/no_interference_update_x-before-analysis.il.expected deleted file mode 100644 index da93bfeeb..000000000 --- a/src/test/correct/no_interference_update_x/gcc_pic/no_interference_update_x-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000002e5", condition()) - ) - ) - Block("1816:l000002e5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - ), - jumps( - GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000030c", condition()) - ) - ) - Block("1828:l0000030c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l000002f3", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000002ff", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l00000299", condition()) - ) - ) - Block("1852:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1900:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l00000493", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l0000053d", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000035c", condition()) - ) - ) - Block("1668:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000035c", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000033e", condition()) - ) - ) - Block("1704:l0000033e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000351", condition()) - ) - ) - Block("1724:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000351", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000320", condition()) - ) - ) - Block("1764:l00000320", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000333", condition()) - ) - ) - Block("1784:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000333", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/no_interference_update_y/clang/no_interference_update_y-before-analysis.il.expected b/src/test/correct/no_interference_update_y/clang/no_interference_update_y-before-analysis.il.expected deleted file mode 100644 index 8a23eadb8..000000000 --- a/src/test/correct/no_interference_update_y/clang/no_interference_update_y-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002da", condition()) - ) - ) - Block("1752:l000002da", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000301", condition()) - ) - ) - Block("1764:l00000301", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002e8", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002f4", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000295", condition()) - ) - ) - Block("1788:l00000295", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1832:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004d9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001bf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000582", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000351", condition()) - ) - ) - Block("1604:l000001d5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000351", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000333", condition()) - ) - ) - Block("1640:l00000333", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000346", condition()) - ) - ) - Block("1660:l0000021a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000346", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000315", condition()) - ) - ) - Block("1700:l00000315", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000328", condition()) - ) - ) - Block("1720:l00000256", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000328", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/no_interference_update_y/clang_O2/no_interference_update_y-before-analysis.il.expected b/src/test/correct/no_interference_update_y/clang_O2/no_interference_update_y-before-analysis.il.expected deleted file mode 100644 index e47151e8a..000000000 --- a/src/test/correct/no_interference_update_y/clang_O2/no_interference_update_y-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002da", condition()) - ) - ) - Block("1752:l000002da", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000301", condition()) - ) - ) - Block("1764:l00000301", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002e8", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002f4", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000295", condition()) - ) - ) - Block("1788:l00000295", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1832:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004d9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001bf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000582", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000351", condition()) - ) - ) - Block("1604:l000001d5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000351", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000333", condition()) - ) - ) - Block("1640:l00000333", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000346", condition()) - ) - ) - Block("1660:l0000021a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000346", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 1bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000315", condition()) - ) - ) - Block("1700:l00000315", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000328", condition()) - ) - ) - Block("1720:l00000256", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000328", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/no_interference_update_y/clang_no_plt_no_pic/no_interference_update_y-before-analysis.il.expected b/src/test/correct/no_interference_update_y/clang_no_plt_no_pic/no_interference_update_y-before-analysis.il.expected deleted file mode 100644 index 37424e6b7..000000000 --- a/src/test/correct/no_interference_update_y/clang_no_plt_no_pic/no_interference_update_y-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000080c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000851", condition()) - ) - ) - Block("1752:l00000851", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000085f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000878", condition()) - ) - ) - Block("1764:l00000878", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000085f", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000086b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000080c", condition()) - ) - ) - Block("1788:l0000080c", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1832:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000a50", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000736", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000ad7", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000074c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000008c8", condition()) - ) - ) - Block("1604:l0000074c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000008c8", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000008aa", condition()) - ) - ) - Block("1640:l000008aa", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000008bd", condition()) - ) - ) - Block("1660:l00000791", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000008bd", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000088c", condition()) - ) - ) - Block("1700:l0000088c", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000089f", condition()) - ) - ) - Block("1720:l000007cd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000089f", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/no_interference_update_y/clang_pic/no_interference_update_y-before-analysis.il.expected b/src/test/correct/no_interference_update_y/clang_pic/no_interference_update_y-before-analysis.il.expected deleted file mode 100644 index f4a77c1a6..000000000 --- a/src/test/correct/no_interference_update_y/clang_pic/no_interference_update_y-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000002e5", condition()) - ) - ) - Block("1816:l000002e5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) - ), - jumps( - GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000030c", condition()) - ) - ) - Block("1828:l0000030c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l000002f3", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000002ff", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l00000299", condition()) - ) - ) - Block("1852:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1900:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l00000493", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l0000053d", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000035c", condition()) - ) - ) - Block("1668:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000035c", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000033e", condition()) - ) - ) - Block("1704:l0000033e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000351", condition()) - ) - ) - Block("1724:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000351", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4048bv64)])) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000320", condition()) - ) - ) - Block("1764:l00000320", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000333", condition()) - ) - ) - Block("1784:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000333", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/no_interference_update_y/gcc/no_interference_update_y-before-analysis.il.expected b/src/test/correct/no_interference_update_y/gcc/no_interference_update_y-before-analysis.il.expected deleted file mode 100644 index 28b23d5f7..000000000 --- a/src/test/correct/no_interference_update_y/gcc/no_interference_update_y-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002e4", condition()) - ) - ) - Block("1752:l000002e4", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000002f2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000030b", condition()) - ) - ) - Block("1764:l0000030b", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002f2", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002fe", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000299", condition()) - ) - ) - Block("1788:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004e4", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000058e", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000035b", condition()) - ) - ) - Block("1604:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000035b", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000033d", condition()) - ) - ) - Block("1640:l0000033d", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000350", condition()) - ) - ) - Block("1660:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000350", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000031f", condition()) - ) - ) - Block("1700:l0000031f", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000332", condition()) - ) - ) - Block("1720:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000332", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/no_interference_update_y/gcc_O2/no_interference_update_y-before-analysis.il.expected b/src/test/correct/no_interference_update_y/gcc_O2/no_interference_update_y-before-analysis.il.expected deleted file mode 100644 index bebedbe2b..000000000 --- a/src/test/correct/no_interference_update_y/gcc_O2/no_interference_update_y-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f3", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000031c", condition()) - ) - ) - Block("1816:l0000031c", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000032a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000343", condition()) - ) - ) - Block("1828:l00000343", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000032a", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000336", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f3", condition()) - ) - ) - Block("1852:l000002f3", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l00000526", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l0000021d", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005da", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000233", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000393", condition()) - ) - ) - Block("1668:l00000233", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000393", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000375", condition()) - ) - ) - Block("1704:l00000375", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000388", condition()) - ) - ) - Block("1724:l00000278", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000388", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R2, bv64) := 1bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R2, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000357", condition()) - ) - ) - Block("1764:l00000357", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000036a", condition()) - ) - ) - Block("1784:l000002b4", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000036a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/no_interference_update_y/gcc_no_plt_no_pic/no_interference_update_y-before-analysis.il.expected b/src/test/correct/no_interference_update_y/gcc_no_plt_no_pic/no_interference_update_y-before-analysis.il.expected deleted file mode 100644 index d319879d6..000000000 --- a/src/test/correct/no_interference_update_y/gcc_no_plt_no_pic/no_interference_update_y-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000081c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000867", condition()) - ) - ) - Block("1752:l00000867", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000088e", condition()) - ) - ) - Block("1764:l0000088e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000875", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000881", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000081c", condition()) - ) - ) - Block("1788:l0000081c", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000a67", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000746", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000aef", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l0000075c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000008de", condition()) - ) - ) - Block("1604:l0000075c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000008de", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000008c0", condition()) - ) - ) - Block("1640:l000008c0", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000008d3", condition()) - ) - ) - Block("1660:l000007a1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000008d3", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000008a2", condition()) - ) - ) - Block("1700:l000008a2", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000008b5", condition()) - ) - ) - Block("1720:l000007dd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000008b5", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/no_interference_update_y/gcc_pic/no_interference_update_y-before-analysis.il.expected b/src/test/correct/no_interference_update_y/gcc_pic/no_interference_update_y-before-analysis.il.expected deleted file mode 100644 index 9701eb1d7..000000000 --- a/src/test/correct/no_interference_update_y/gcc_pic/no_interference_update_y-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000002e5", condition()) - ) - ) - Block("1816:l000002e5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - ), - jumps( - GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000030c", condition()) - ) - ) - Block("1828:l0000030c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l000002f3", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000002ff", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l00000299", condition()) - ) - ) - Block("1852:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1900:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l00000493", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l0000053d", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000035c", condition()) - ) - ) - Block("1668:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000035c", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000033e", condition()) - ) - ) - Block("1704:l0000033e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000351", condition()) - ) - ) - Block("1724:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000351", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000320", condition()) - ) - ) - Block("1764:l00000320", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000333", condition()) - ) - ) - Block("1784:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000333", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/secret_write/clang/secret_write-before-analysis.il.expected b/src/test/correct/secret_write/clang/secret_write-before-analysis.il.expected deleted file mode 100644 index 0a615f2f8..000000000 --- a/src/test/correct/secret_write/clang/secret_write-before-analysis.il.expected +++ /dev/null @@ -1,315 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000346", condition()) - ) - ) - Block("1752:l00000346", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000354", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000036d", condition()) - ) - ) - Block("1764:l0000036d", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000354", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000360", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002bd", condition()) - ) - ) - Block("1788:l000002bd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l0000054f", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001e7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000602", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003bd", condition()) - ) - ) - Block("1604:l000001fd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003bd", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000039f", condition()) - ) - ) - Block("1640:l0000039f", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003b2", condition()) - ) - ) - Block("1660:l00000242", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003b2", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 60bv64)] := Extract(Register(R10, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 60bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000381", condition()) - ) - ) - Block("1700:l00000381", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000394", condition()) - ) - ) - Block("1720:l0000027e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000394", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/secret_write/clang_O2/secret_write-before-analysis.il.expected b/src/test/correct/secret_write/clang_O2/secret_write-before-analysis.il.expected deleted file mode 100644 index 59205a2db..000000000 --- a/src/test/correct/secret_write/clang_O2/secret_write-before-analysis.il.expected +++ /dev/null @@ -1,307 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000029d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002ee", condition()) - ) - ) - Block("1752:l000002ee", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002fc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000315", condition()) - ) - ) - Block("1764:l00000315", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002fc", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000308", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000029d", condition()) - ) - ) - Block("1788:l0000029d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1840:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1840:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004ef", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000059a", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000365", condition()) - ) - ) - Block("1604:l000001dd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000365", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000347", condition()) - ) - ) - Block("1640:l00000347", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000222", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000035a", condition()) - ) - ) - Block("1660:l00000222", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000035a", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R10, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 60bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R10, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000329", condition()) - ) - ) - Block("1700:l00000329", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000025e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000033c", condition()) - ) - ) - Block("1720:l0000025e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000033c", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/secret_write/clang_no_plt_no_pic/secret_write-before-analysis.il.expected b/src/test/correct/secret_write/clang_no_plt_no_pic/secret_write-before-analysis.il.expected deleted file mode 100644 index 35651033b..000000000 --- a/src/test/correct/secret_write/clang_no_plt_no_pic/secret_write-before-analysis.il.expected +++ /dev/null @@ -1,315 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008b4", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000093d", condition()) - ) - ) - Block("1752:l0000093d", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000094b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000964", condition()) - ) - ) - Block("1764:l00000964", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000094b", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000957", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008b4", condition()) - ) - ) - Block("1788:l000008b4", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b46", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007de", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000bd7", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000007f4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000009b4", condition()) - ) - ) - Block("1604:l000007f4", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000009b4", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000839", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000996", condition()) - ) - ) - Block("1640:l00000996", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000839", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009a9", condition()) - ) - ) - Block("1660:l00000839", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009a9", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 60bv64)] := Extract(Register(R10, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 60bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 52bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000978", condition()) - ) - ) - Block("1700:l00000978", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000098b", condition()) - ) - ) - Block("1720:l00000875", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000098b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/secret_write/clang_pic/secret_write-before-analysis.il.expected b/src/test/correct/secret_write/clang_pic/secret_write-before-analysis.il.expected deleted file mode 100644 index 0000d68f5..000000000 --- a/src/test/correct/secret_write/clang_pic/secret_write-before-analysis.il.expected +++ /dev/null @@ -1,318 +0,0 @@ -Procedure("1552:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002c9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000367", condition()) - ) - ) - Block("1816:l00000367", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4016bv64)])) - ), - jumps( - GoTo("1840:l00000375", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000038e", condition()) - ) - ) - Block("1828:l0000038e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1552:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000375", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000381", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002c9", condition()) - ) - ) - Block("1852:l000002c9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1948:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1948:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1480:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1480:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1496bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1496:l00000573", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1536:__libc_start_main", condition()) - ) - ) - Block("1648:l000001f3", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1584:abort", condition()) - ) - ) - Block("?:l00000629", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1584:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1668:l00000209", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003de", condition()) - ) - ) - Block("1668:l00000209", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003de", - statements( - ), - jumps( - GoTo("1568:l__gmon_start__", condition()) - ) - ) - Block("1568:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003c0", condition()) - ) - ) - Block("1704:l000003c0", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4008bv64)])) - ), - jumps( - GoTo("1724:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003d3", condition()) - ) - ) - Block("1724:l0000024e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003d3", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4024bv64)])) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R9, bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4048bv64)])) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R10, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R9, bv64)]), 32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 1bv32), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003a2", condition()) - ) - ) - Block("1764:l000003a2", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l0000028a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003b5", condition()) - ) - ) - Block("1784:l0000028a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003b5", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/secret_write/gcc/secret_write-before-analysis.il.expected b/src/test/correct/secret_write/gcc/secret_write-before-analysis.il.expected deleted file mode 100644 index bf6d5b4e6..000000000 --- a/src/test/correct/secret_write/gcc/secret_write-before-analysis.il.expected +++ /dev/null @@ -1,328 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002f1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000003c3", condition()) - ) - ) - Block("1752:l000003c3", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000003d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003ea", condition()) - ) - ) - Block("1764:l000003ea", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000003d1", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000003dd", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002f1", condition()) - ) - ) - Block("1788:l000002f1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1924:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1924:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000005d9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000021b", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000699", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000231", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000043a", condition()) - ) - ) - Block("1604:l00000231", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000043a", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000041c", condition()) - ) - ) - Block("1640:l0000041c", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000042f", condition()) - ) - ) - Block("1660:l00000276", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000042f", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 28bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000002b2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003fe", condition()) - ) - ) - Block("1700:l000003fe", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000002b2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000411", condition()) - ) - ) - Block("1720:l000002b2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000411", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/secret_write/gcc_O2/secret_write-before-analysis.il.expected b/src/test/correct/secret_write/gcc_O2/secret_write-before-analysis.il.expected deleted file mode 100644 index ababc3d28..000000000 --- a/src/test/correct/secret_write/gcc_O2/secret_write-before-analysis.il.expected +++ /dev/null @@ -1,307 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002fc", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000325", condition()) - ) - ) - Block("1816:l00000325", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l00000333", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000034c", condition()) - ) - ) - Block("1828:l0000034c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000333", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000033f", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002fc", condition()) - ) - ) - Block("1852:l000002fc", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l0000052f", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000226", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005e3", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l0000023c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000039c", condition()) - ) - ) - Block("1668:l0000023c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000039c", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000281", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000037e", condition()) - ) - ) - Block("1704:l0000037e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000281", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000391", condition()) - ) - ) - Block("1724:l00000281", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000391", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) - LocalAssign(Register(R3, bv64) := 2bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R2, bv64), 4bv64)] := Extract(Register(R3, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000360", condition()) - ) - ) - Block("1764:l00000360", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002bd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000373", condition()) - ) - ) - Block("1784:l000002bd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000373", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/secret_write/gcc_no_plt_no_pic/secret_write-before-analysis.il.expected b/src/test/correct/secret_write/gcc_no_plt_no_pic/secret_write-before-analysis.il.expected deleted file mode 100644 index a47910220..000000000 --- a/src/test/correct/secret_write/gcc_no_plt_no_pic/secret_write-before-analysis.il.expected +++ /dev/null @@ -1,328 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000097f", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000a51", condition()) - ) - ) - Block("1752:l00000a51", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000a5f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000a78", condition()) - ) - ) - Block("1764:l00000a78", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000a5f", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000a6b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000097f", condition()) - ) - ) - Block("1788:l0000097f", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1924:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1924:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000c67", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000008a9", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000d05", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000008bf", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000ac8", condition()) - ) - ) - Block("1604:l000008bf", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000ac8", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000904", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000aaa", condition()) - ) - ) - Block("1640:l00000aaa", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000904", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000abd", condition()) - ) - ) - Block("1660:l00000904", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000abd", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 28bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000940", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000a8c", condition()) - ) - ) - Block("1700:l00000a8c", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000940", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000a9f", condition()) - ) - ) - Block("1720:l00000940", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000a9f", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/secret_write/gcc_pic/secret_write-before-analysis.il.expected b/src/test/correct/secret_write/gcc_pic/secret_write-before-analysis.il.expected deleted file mode 100644 index 476e0f916..000000000 --- a/src/test/correct/secret_write/gcc_pic/secret_write-before-analysis.il.expected +++ /dev/null @@ -1,328 +0,0 @@ -Procedure("1552:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000003cb", condition()) - ) - ) - Block("1816:l000003cb", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1840:l000003d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l000003f2", condition()) - ) - ) - Block("1828:l000003f2", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1552:__cxa_finalize", condition()) - ) - ) - Block("1840:l000003d9", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000003e5", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f1", condition()) - ) - ) - Block("1852:l000002f1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1988:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1988:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1480:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1480:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1496bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1496:l000005e1", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1536:__libc_start_main", condition()) - ) - ) - Block("1648:l0000021b", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1584:abort", condition()) - ) - ) - Block("?:l000006a1", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1584:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1668:l00000231", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000442", condition()) - ) - ) - Block("1668:l00000231", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000442", - statements( - ), - jumps( - GoTo("1568:l__gmon_start__", condition()) - ) - ) - Block("1568:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000424", condition()) - ) - ) - Block("1704:l00000424", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1724:l00000276", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000437", condition()) - ) - ) - Block("1724:l00000276", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000437", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R1, bv64) := ZeroExtend(BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 1bv32), 32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002b2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000406", condition()) - ) - ) - Block("1764:l00000406", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002b2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000419", condition()) - ) - ) - Block("1784:l000002b2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000419", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/simple_jump/clang/simple_jump-before-analysis.il.expected b/src/test/correct/simple_jump/clang/simple_jump-before-analysis.il.expected deleted file mode 100644 index d4c21d9c3..000000000 --- a/src/test/correct/simple_jump/clang/simple_jump-before-analysis.il.expected +++ /dev/null @@ -1,362 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000360", condition()) - ) - ) - Block("1752:l00000360", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000036e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000387", condition()) - ) - ) - Block("1764:l00000387", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000036e", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000037a", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002bd", condition()) - ) - ) - Block("1788:l000002bd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000569", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001e7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000061d", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003d7", condition()) - ) - ) - Block("1604:l000001fd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003d7", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003b9", condition()) - ) - ) - Block("1640:l000003b9", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003cc", condition()) - ) - ) - Block("1660:l00000242", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003cc", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967290bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934587bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967291bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000326", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000329", condition()) - ) - ) - Block("?:l00000329", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l0000032c", condition()) - ) - ) - Block("?:l00000326", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l0000032c", condition()) - ) - ) - Block("?:l0000032c", - statements( - ), - jumps( - GoTo("1860:l00000334", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1844:l0000034b", condition()) - ) - ) - Block("1844:l0000034b", - statements( - ), - jumps( - GoTo("1848:l0000034c", condition()) - ) - ) - Block("1848:l0000034c", - statements( - LocalAssign(Register(R8, bv64) := 6bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1860:l00000334", condition()) - ) - ) - Block("1860:l00000334", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000039b", condition()) - ) - ) - Block("1700:l0000039b", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003ae", condition()) - ) - ) - Block("1720:l0000027e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003ae", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/simple_jump/clang_O2/simple_jump-before-analysis.il.expected b/src/test/correct/simple_jump/clang_O2/simple_jump-before-analysis.il.expected deleted file mode 100644 index 5a5a5bf1d..000000000 --- a/src/test/correct/simple_jump/clang_O2/simple_jump-before-analysis.il.expected +++ /dev/null @@ -1,302 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000289", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002bc", condition()) - ) - ) - Block("1752:l000002bc", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002ca", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000002e3", condition()) - ) - ) - Block("1764:l000002e3", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002ca", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002d6", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000289", condition()) - ) - ) - Block("1788:l00000289", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1820:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1820:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004b8", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001b3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000055e", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001c9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000333", condition()) - ) - ) - Block("1604:l000001c9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000333", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000020e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000315", condition()) - ) - ) - Block("1640:l00000315", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000020e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000328", condition()) - ) - ) - Block("1660:l0000020e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000328", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000002f7", condition()) - ) - ) - Block("1700:l000002f7", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000030a", condition()) - ) - ) - Block("1720:l0000024a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000030a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/simple_jump/clang_no_plt_no_pic/simple_jump-before-analysis.il.expected b/src/test/correct/simple_jump/clang_no_plt_no_pic/simple_jump-before-analysis.il.expected deleted file mode 100644 index aa9a322fd..000000000 --- a/src/test/correct/simple_jump/clang_no_plt_no_pic/simple_jump-before-analysis.il.expected +++ /dev/null @@ -1,362 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008cf", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000972", condition()) - ) - ) - Block("1752:l00000972", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000980", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000999", condition()) - ) - ) - Block("1764:l00000999", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000980", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000098c", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008cf", condition()) - ) - ) - Block("1788:l000008cf", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b7b", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007f9", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c0c", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000080f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000009e9", condition()) - ) - ) - Block("1604:l0000080f", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000009e9", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000854", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009cb", condition()) - ) - ) - Block("1640:l000009cb", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000854", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009de", condition()) - ) - ) - Block("1660:l00000854", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009de", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967290bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934587bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967291bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000938", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l0000093b", condition()) - ) - ) - Block("?:l0000093b", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l0000093e", condition()) - ) - ) - Block("?:l00000938", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l0000093e", condition()) - ) - ) - Block("?:l0000093e", - statements( - ), - jumps( - GoTo("1860:l00000946", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1844:l0000095d", condition()) - ) - ) - Block("1844:l0000095d", - statements( - ), - jumps( - GoTo("1848:l0000095e", condition()) - ) - ) - Block("1848:l0000095e", - statements( - LocalAssign(Register(R8, bv64) := 6bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1860:l00000946", condition()) - ) - ) - Block("1860:l00000946", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000890", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009ad", condition()) - ) - ) - Block("1700:l000009ad", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000890", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009c0", condition()) - ) - ) - Block("1720:l00000890", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009c0", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/simple_jump/clang_pic/simple_jump-before-analysis.il.expected b/src/test/correct/simple_jump/clang_pic/simple_jump-before-analysis.il.expected deleted file mode 100644 index aa9a322fd..000000000 --- a/src/test/correct/simple_jump/clang_pic/simple_jump-before-analysis.il.expected +++ /dev/null @@ -1,362 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008cf", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000972", condition()) - ) - ) - Block("1752:l00000972", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000980", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000999", condition()) - ) - ) - Block("1764:l00000999", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000980", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000098c", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008cf", condition()) - ) - ) - Block("1788:l000008cf", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b7b", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007f9", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c0c", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000080f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000009e9", condition()) - ) - ) - Block("1604:l0000080f", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000009e9", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000854", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009cb", condition()) - ) - ) - Block("1640:l000009cb", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000854", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009de", condition()) - ) - ) - Block("1660:l00000854", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009de", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967290bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934587bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967291bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000938", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l0000093b", condition()) - ) - ) - Block("?:l0000093b", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l0000093e", condition()) - ) - ) - Block("?:l00000938", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l0000093e", condition()) - ) - ) - Block("?:l0000093e", - statements( - ), - jumps( - GoTo("1860:l00000946", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1844:l0000095d", condition()) - ) - ) - Block("1844:l0000095d", - statements( - ), - jumps( - GoTo("1848:l0000095e", condition()) - ) - ) - Block("1848:l0000095e", - statements( - LocalAssign(Register(R8, bv64) := 6bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1860:l00000946", condition()) - ) - ) - Block("1860:l00000946", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000890", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009ad", condition()) - ) - ) - Block("1700:l000009ad", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000890", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009c0", condition()) - ) - ) - Block("1720:l00000890", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009c0", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/simple_jump/gcc/simple_jump-before-analysis.il.expected b/src/test/correct/simple_jump/gcc/simple_jump-before-analysis.il.expected deleted file mode 100644 index 1ca93c719..000000000 --- a/src/test/correct/simple_jump/gcc/simple_jump-before-analysis.il.expected +++ /dev/null @@ -1,329 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002ad", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000032c", condition()) - ) - ) - Block("1752:l0000032c", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l0000033a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000353", condition()) - ) - ) - Block("1764:l00000353", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000033a", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000346", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002ad", condition()) - ) - ) - Block("1788:l000002ad", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1856:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000531", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001d7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005e2", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000001ed", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003a3", condition()) - ) - ) - Block("1604:l000001ed", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003a3", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000232", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000385", condition()) - ) - ) - Block("1640:l00000385", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000232", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000398", condition()) - ) - ) - Block("1660:l00000232", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000398", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1844:l0000030a", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1836:l0000031f", condition()) - ) - ) - Block("1836:l0000031f", - statements( - LocalAssign(Register(R0, bv64) := 6bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1844:l0000030a", condition()) - ) - ) - Block("1844:l0000030a", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000026e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000367", condition()) - ) - ) - Block("1700:l00000367", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000026e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000037a", condition()) - ) - ) - Block("1720:l0000026e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000037a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/simple_jump/gcc_O2/simple_jump-before-analysis.il.expected b/src/test/correct/simple_jump/gcc_O2/simple_jump-before-analysis.il.expected deleted file mode 100644 index 82dc9ebf6..000000000 --- a/src/test/correct/simple_jump/gcc_O2/simple_jump-before-analysis.il.expected +++ /dev/null @@ -1,302 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002e7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000310", condition()) - ) - ) - Block("1816:l00000310", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000031e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000337", condition()) - ) - ) - Block("1828:l00000337", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000031e", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000032a", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002e7", condition()) - ) - ) - Block("1852:l000002e7", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l0000051a", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000211", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005ce", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000227", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000387", condition()) - ) - ) - Block("1668:l00000227", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000387", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000026c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000369", condition()) - ) - ) - Block("1704:l00000369", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l0000026c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l0000037c", condition()) - ) - ) - Block("1724:l0000026c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l0000037c", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002a8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000034b", condition()) - ) - ) - Block("1764:l0000034b", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002a8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000035e", condition()) - ) - ) - Block("1784:l000002a8", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000035e", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/simple_jump/gcc_no_plt_no_pic/simple_jump-before-analysis.il.expected b/src/test/correct/simple_jump/gcc_no_plt_no_pic/simple_jump-before-analysis.il.expected deleted file mode 100644 index db6fb9227..000000000 --- a/src/test/correct/simple_jump/gcc_no_plt_no_pic/simple_jump-before-analysis.il.expected +++ /dev/null @@ -1,329 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000884", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000903", condition()) - ) - ) - Block("1752:l00000903", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000911", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000092a", condition()) - ) - ) - Block("1764:l0000092a", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000911", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000091d", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000884", condition()) - ) - ) - Block("1788:l00000884", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1856:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b08", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007ae", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000b95", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000007c4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000097a", condition()) - ) - ) - Block("1604:l000007c4", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000097a", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000809", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000095c", condition()) - ) - ) - Block("1640:l0000095c", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000809", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000096f", condition()) - ) - ) - Block("1660:l00000809", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000096f", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1844:l000008e1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1836:l000008f6", condition()) - ) - ) - Block("1836:l000008f6", - statements( - LocalAssign(Register(R0, bv64) := 6bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1844:l000008e1", condition()) - ) - ) - Block("1844:l000008e1", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000845", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000093e", condition()) - ) - ) - Block("1700:l0000093e", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000845", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000951", condition()) - ) - ) - Block("1720:l00000845", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000951", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/simple_jump/gcc_pic/simple_jump-before-analysis.il.expected b/src/test/correct/simple_jump/gcc_pic/simple_jump-before-analysis.il.expected deleted file mode 100644 index db6fb9227..000000000 --- a/src/test/correct/simple_jump/gcc_pic/simple_jump-before-analysis.il.expected +++ /dev/null @@ -1,329 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000884", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000903", condition()) - ) - ) - Block("1752:l00000903", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000911", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000092a", condition()) - ) - ) - Block("1764:l0000092a", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000911", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000091d", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000884", condition()) - ) - ) - Block("1788:l00000884", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1856:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b08", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007ae", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000b95", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000007c4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000097a", condition()) - ) - ) - Block("1604:l000007c4", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000097a", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000809", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000095c", condition()) - ) - ) - Block("1640:l0000095c", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000809", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000096f", condition()) - ) - ) - Block("1660:l00000809", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000096f", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1844:l000008e1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1836:l000008f6", condition()) - ) - ) - Block("1836:l000008f6", - statements( - LocalAssign(Register(R0, bv64) := 6bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1844:l000008e1", condition()) - ) - ) - Block("1844:l000008e1", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000845", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000093e", condition()) - ) - ) - Block("1700:l0000093e", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000845", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000951", condition()) - ) - ) - Block("1720:l00000845", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000951", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/switch/clang/switch-before-analysis.il.expected b/src/test/correct/switch/clang/switch-before-analysis.il.expected deleted file mode 100644 index 0a8c87422..000000000 --- a/src/test/correct/switch/clang/switch-before-analysis.il.expected +++ /dev/null @@ -1,426 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002e9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000003ec", condition()) - ) - ) - Block("1752:l000003ec", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000003fa", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000413", condition()) - ) - ) - Block("1764:l00000413", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000003fa", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000406", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002e9", condition()) - ) - ) - Block("1788:l000002e9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1916:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1916:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000600", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000213", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000006c0", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000229", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000463", condition()) - ) - ) - Block("1604:l00000229", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000463", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000026e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000445", condition()) - ) - ) - Block("1640:l00000445", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000026e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000458", condition()) - ) - ) - Block("1660:l0000026e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000458", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l0000035a", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("?:l0000035d", condition()) - ) - ) - Block("?:l0000035d", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000360", condition()) - ) - ) - Block("?:l0000035a", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000360", condition()) - ) - ) - Block("?:l00000360", - statements( - ), - jumps( - GoTo("1884:l00000368", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1848:l0000039a", condition()) - ) - ) - Block("1848:l0000039a", - statements( - ), - jumps( - GoTo("1852:l0000039b", condition()) - ) - ) - Block("1852:l0000039b", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l000003c4", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l000003c7", condition()) - ) - ) - Block("?:l000003c7", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l000003ca", condition()) - ) - ) - Block("?:l000003c4", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l000003ca", condition()) - ) - ) - Block("?:l000003ca", - statements( - ), - jumps( - GoTo("1896:l00000389", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1868:l000003d7", condition()) - ) - ) - Block("1896:l00000389", - statements( - LocalAssign(Register(R8, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1908:l0000037b", condition()) - ) - ) - Block("1868:l000003d7", - statements( - ), - jumps( - GoTo("1872:l000003d8", condition()) - ) - ) - Block("1872:l000003d8", - statements( - LocalAssign(Register(R8, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1884:l00000368", condition()) - ) - ) - Block("1884:l00000368", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1908:l0000037b", condition()) - ) - ) - Block("1908:l0000037b", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000002aa", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000427", condition()) - ) - ) - Block("1700:l00000427", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000002aa", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000043a", condition()) - ) - ) - Block("1720:l000002aa", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000043a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/switch/clang_O2/switch-before-analysis.il.expected b/src/test/correct/switch/clang_O2/switch-before-analysis.il.expected deleted file mode 100644 index af5bdc2a2..000000000 --- a/src/test/correct/switch/clang_O2/switch-before-analysis.il.expected +++ /dev/null @@ -1,301 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000285", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002b3", condition()) - ) - ) - Block("1752:l000002b3", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002c1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000002da", condition()) - ) - ) - Block("1764:l000002da", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002c1", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002cd", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000285", condition()) - ) - ) - Block("1788:l00000285", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1816:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1816:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004ae", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001af", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000553", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001c5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000032a", condition()) - ) - ) - Block("1604:l000001c5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000032a", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000020a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000030c", condition()) - ) - ) - Block("1640:l0000030c", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000020a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000031f", condition()) - ) - ) - Block("1660:l0000020a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000031f", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000002ee", condition()) - ) - ) - Block("1700:l000002ee", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000301", condition()) - ) - ) - Block("1720:l00000246", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000301", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/switch/clang_no_plt_no_pic/switch-before-analysis.il.expected b/src/test/correct/switch/clang_no_plt_no_pic/switch-before-analysis.il.expected deleted file mode 100644 index 3009c2547..000000000 --- a/src/test/correct/switch/clang_no_plt_no_pic/switch-before-analysis.il.expected +++ /dev/null @@ -1,426 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000099e", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000aa1", condition()) - ) - ) - Block("1752:l00000aa1", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000aaf", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000ac8", condition()) - ) - ) - Block("1764:l00000ac8", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000aaf", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000abb", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000099e", condition()) - ) - ) - Block("1788:l0000099e", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1916:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1916:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000cb5", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000008c8", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000d51", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000008de", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000b18", condition()) - ) - ) - Block("1604:l000008de", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000b18", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000923", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000afa", condition()) - ) - ) - Block("1640:l00000afa", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000923", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000b0d", condition()) - ) - ) - Block("1660:l00000923", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000b0d", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000a0f", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("?:l00000a12", condition()) - ) - ) - Block("?:l00000a12", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000a15", condition()) - ) - ) - Block("?:l00000a0f", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000a15", condition()) - ) - ) - Block("?:l00000a15", - statements( - ), - jumps( - GoTo("1884:l00000a1d", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1848:l00000a4f", condition()) - ) - ) - Block("1848:l00000a4f", - statements( - ), - jumps( - GoTo("1852:l00000a50", condition()) - ) - ) - Block("1852:l00000a50", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000a79", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000a7c", condition()) - ) - ) - Block("?:l00000a7c", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000a7f", condition()) - ) - ) - Block("?:l00000a79", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000a7f", condition()) - ) - ) - Block("?:l00000a7f", - statements( - ), - jumps( - GoTo("1896:l00000a3e", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1868:l00000a8c", condition()) - ) - ) - Block("1896:l00000a3e", - statements( - LocalAssign(Register(R8, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1908:l00000a30", condition()) - ) - ) - Block("1868:l00000a8c", - statements( - ), - jumps( - GoTo("1872:l00000a8d", condition()) - ) - ) - Block("1872:l00000a8d", - statements( - LocalAssign(Register(R8, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1884:l00000a1d", condition()) - ) - ) - Block("1884:l00000a1d", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1908:l00000a30", condition()) - ) - ) - Block("1908:l00000a30", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000095f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000adc", condition()) - ) - ) - Block("1700:l00000adc", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000095f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000aef", condition()) - ) - ) - Block("1720:l0000095f", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000aef", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/switch/clang_pic/switch-before-analysis.il.expected b/src/test/correct/switch/clang_pic/switch-before-analysis.il.expected deleted file mode 100644 index 3009c2547..000000000 --- a/src/test/correct/switch/clang_pic/switch-before-analysis.il.expected +++ /dev/null @@ -1,426 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000099e", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000aa1", condition()) - ) - ) - Block("1752:l00000aa1", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000aaf", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000ac8", condition()) - ) - ) - Block("1764:l00000ac8", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000aaf", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000abb", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000099e", condition()) - ) - ) - Block("1788:l0000099e", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1916:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1916:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000cb5", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000008c8", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000d51", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000008de", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000b18", condition()) - ) - ) - Block("1604:l000008de", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000b18", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000923", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000afa", condition()) - ) - ) - Block("1640:l00000afa", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000923", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000b0d", condition()) - ) - ) - Block("1660:l00000923", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000b0d", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000a0f", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("?:l00000a12", condition()) - ) - ) - Block("?:l00000a12", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000a15", condition()) - ) - ) - Block("?:l00000a0f", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000a15", condition()) - ) - ) - Block("?:l00000a15", - statements( - ), - jumps( - GoTo("1884:l00000a1d", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1848:l00000a4f", condition()) - ) - ) - Block("1848:l00000a4f", - statements( - ), - jumps( - GoTo("1852:l00000a50", condition()) - ) - ) - Block("1852:l00000a50", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000a79", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000a7c", condition()) - ) - ) - Block("?:l00000a7c", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000a7f", condition()) - ) - ) - Block("?:l00000a79", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000a7f", condition()) - ) - ) - Block("?:l00000a7f", - statements( - ), - jumps( - GoTo("1896:l00000a3e", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1868:l00000a8c", condition()) - ) - ) - Block("1896:l00000a3e", - statements( - LocalAssign(Register(R8, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1908:l00000a30", condition()) - ) - ) - Block("1868:l00000a8c", - statements( - ), - jumps( - GoTo("1872:l00000a8d", condition()) - ) - ) - Block("1872:l00000a8d", - statements( - LocalAssign(Register(R8, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1884:l00000a1d", condition()) - ) - ) - Block("1884:l00000a1d", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1908:l00000a30", condition()) - ) - ) - Block("1908:l00000a30", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000095f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000adc", condition()) - ) - ) - Block("1700:l00000adc", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000095f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000aef", condition()) - ) - ) - Block("1720:l0000095f", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000aef", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/switch/gcc/switch-before-analysis.il.expected b/src/test/correct/switch/gcc/switch-before-analysis.il.expected deleted file mode 100644 index 7fd8df680..000000000 --- a/src/test/correct/switch/gcc/switch-before-analysis.il.expected +++ /dev/null @@ -1,361 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000039e", condition()) - ) - ) - Block("1752:l0000039e", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000003ac", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003c5", condition()) - ) - ) - Block("1764:l000003c5", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000003ac", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000003b8", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002d5", condition()) - ) - ) - Block("1788:l000002d5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1896:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000005ad", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001ff", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000066a", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000415", condition()) - ) - ) - Block("1604:l00000215", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000415", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003f7", condition()) - ) - ) - Block("1640:l000003f7", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000040a", condition()) - ) - ) - Block("1660:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000040a", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1860:l00000339", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1840:l0000036b", condition()) - ) - ) - Block("1840:l0000036b", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1872:l0000035c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1852:l00000391", condition()) - ) - ) - Block("1872:l0000035c", - statements( - LocalAssign(Register(R0, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1884:l0000034c", condition()) - ) - ) - Block("1852:l00000391", - statements( - LocalAssign(Register(R0, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1860:l00000339", condition()) - ) - ) - Block("1860:l00000339", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1884:l0000034c", condition()) - ) - ) - Block("1884:l0000034c", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003d9", condition()) - ) - ) - Block("1700:l000003d9", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003ec", condition()) - ) - ) - Block("1720:l00000296", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003ec", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/switch/gcc_O2/switch-before-analysis.il.expected b/src/test/correct/switch/gcc_O2/switch-before-analysis.il.expected deleted file mode 100644 index 7387e4ace..000000000 --- a/src/test/correct/switch/gcc_O2/switch-before-analysis.il.expected +++ /dev/null @@ -1,301 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002e4", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000030d", condition()) - ) - ) - Block("1816:l0000030d", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000031b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000334", condition()) - ) - ) - Block("1828:l00000334", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000031b", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000327", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002e4", condition()) - ) - ) - Block("1852:l000002e4", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l00000517", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l0000020e", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005cb", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000224", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000384", condition()) - ) - ) - Block("1668:l00000224", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000384", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000269", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000366", condition()) - ) - ) - Block("1704:l00000366", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000269", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000379", condition()) - ) - ) - Block("1724:l00000269", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000379", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002a5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000348", condition()) - ) - ) - Block("1764:l00000348", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002a5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000035b", condition()) - ) - ) - Block("1784:l000002a5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000035b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/switch/gcc_no_plt_no_pic/switch-before-analysis.il.expected b/src/test/correct/switch/gcc_no_plt_no_pic/switch-before-analysis.il.expected deleted file mode 100644 index ce585fc5b..000000000 --- a/src/test/correct/switch/gcc_no_plt_no_pic/switch-before-analysis.il.expected +++ /dev/null @@ -1,361 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000934", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000009fd", condition()) - ) - ) - Block("1752:l000009fd", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000a0b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000a24", condition()) - ) - ) - Block("1764:l00000a24", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000a0b", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000a17", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000934", condition()) - ) - ) - Block("1788:l00000934", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1896:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000c0c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000085e", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000ca3", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000874", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a74", condition()) - ) - ) - Block("1604:l00000874", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a74", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000008b9", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000a56", condition()) - ) - ) - Block("1640:l00000a56", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l000008b9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a69", condition()) - ) - ) - Block("1660:l000008b9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a69", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1860:l00000998", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1840:l000009ca", condition()) - ) - ) - Block("1840:l000009ca", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1872:l000009bb", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1852:l000009f0", condition()) - ) - ) - Block("1872:l000009bb", - statements( - LocalAssign(Register(R0, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1884:l000009ab", condition()) - ) - ) - Block("1852:l000009f0", - statements( - LocalAssign(Register(R0, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1860:l00000998", condition()) - ) - ) - Block("1860:l00000998", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1884:l000009ab", condition()) - ) - ) - Block("1884:l000009ab", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008f5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000a38", condition()) - ) - ) - Block("1700:l00000a38", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000008f5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000a4b", condition()) - ) - ) - Block("1720:l000008f5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000a4b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/switch/gcc_pic/switch-before-analysis.il.expected b/src/test/correct/switch/gcc_pic/switch-before-analysis.il.expected deleted file mode 100644 index ce585fc5b..000000000 --- a/src/test/correct/switch/gcc_pic/switch-before-analysis.il.expected +++ /dev/null @@ -1,361 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000934", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000009fd", condition()) - ) - ) - Block("1752:l000009fd", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000a0b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000a24", condition()) - ) - ) - Block("1764:l00000a24", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000a0b", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000a17", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000934", condition()) - ) - ) - Block("1788:l00000934", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1896:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000c0c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000085e", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000ca3", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000874", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a74", condition()) - ) - ) - Block("1604:l00000874", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a74", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000008b9", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000a56", condition()) - ) - ) - Block("1640:l00000a56", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l000008b9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a69", condition()) - ) - ) - Block("1660:l000008b9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a69", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1860:l00000998", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1840:l000009ca", condition()) - ) - ) - Block("1840:l000009ca", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1872:l000009bb", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1852:l000009f0", condition()) - ) - ) - Block("1872:l000009bb", - statements( - LocalAssign(Register(R0, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1884:l000009ab", condition()) - ) - ) - Block("1852:l000009f0", - statements( - LocalAssign(Register(R0, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1860:l00000998", condition()) - ) - ) - Block("1860:l00000998", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1884:l000009ab", condition()) - ) - ) - Block("1884:l000009ab", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008f5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000a38", condition()) - ) - ) - Block("1700:l00000a38", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000008f5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000a4b", condition()) - ) - ) - Block("1720:l000008f5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000a4b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/switch2/clang_O2/switch2-before-analysis.il.expected b/src/test/correct/switch2/clang_O2/switch2-before-analysis.il.expected deleted file mode 100644 index c260ea2e5..000000000 --- a/src/test/correct/switch2/clang_O2/switch2-before-analysis.il.expected +++ /dev/null @@ -1,311 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000028d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002c5", condition()) - ) - ) - Block("1752:l000002c5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002d3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000002ec", condition()) - ) - ) - Block("1764:l000002ec", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002d3", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002df", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000028d", condition()) - ) - ) - Block("1788:l0000028d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1824:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1824:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004c2", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001b7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000056b", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000033c", condition()) - ) - ) - Block("1604:l000001cd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000033c", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000212", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000031e", condition()) - ) - ) - Block("1640:l0000031e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000212", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000331", condition()) - ) - ) - Block("1660:l00000212", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000331", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1820:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1820:lmain", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1812:r", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1812:lr", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000300", condition()) - ) - ) - Block("1700:l00000300", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000024e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000313", condition()) - ) - ) - Block("1720:l0000024e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000313", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/switch2/gcc/switch2-before-analysis.il.expected b/src/test/correct/switch2/gcc/switch2-before-analysis.il.expected deleted file mode 100644 index e4d88c7f3..000000000 --- a/src/test/correct/switch2/gcc/switch2-before-analysis.il.expected +++ /dev/null @@ -1,502 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000349", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000055a", condition()) - ) - ) - Block("1752:l0000055a", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000568", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000581", condition()) - ) - ) - Block("1764:l00000581", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000568", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000574", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000349", condition()) - ) - ) - Block("1788:l00000349", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2012:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2012:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#14, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#14, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#14, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#14, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000786", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000273", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000086a", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000289", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000005d1", condition()) - ) - ) - Block("1604:l00000289", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000005d1", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000002ce", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000005b3", condition()) - ) - ) - Block("1640:l000005b3", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l000002ce", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000005c6", condition()) - ) - ) - Block("1660:l000002ce", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000005c6", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1820:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1820:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1980:l000003d0", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1852:l00000408", condition()) - ) - ) - Block("1980:l000003d0", - statements( - LocalAssign(Register(R0, bv64) := 4bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1988:l000003e2", condition()) - ) - ) - Block("1852:l00000408", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1988:l000003e2", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("1864:l00000430", condition()) - ) - ) - Block("1864:l00000430", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#7, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#7, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1968:l00000451", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1876:l00000467", condition()) - ) - ) - Block("1876:l00000467", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#8, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#8, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1988:l000003e2", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("1888:l0000048f", condition()) - ) - ) - Block("1888:l0000048f", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#9, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#9, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1940:l000004b0", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1900:l000004e2", condition()) - ) - ) - Block("1940:l000004b0", - statements( - LocalAssign(Register(R30, bv64) := 1944bv64) - ), - jumps( - DirectCall("1812:r", condition()) - ) - ) - Block("1944:l000004bc", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1948:l000004c4", condition()) - ) - ) - Block("1900:l000004e2", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#10, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#10, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1988:l000003e2", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("1912:l0000050a", condition()) - ) - ) - Block("1912:l0000050a", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#11, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#11, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1948:l000004c4", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1924:l00000530", condition()) - ) - ) - Block("1948:l000004c4", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("2000:l000003f1", condition()) - ) - ) - Block("1924:l00000530", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#12, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#12, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1960:l000004d5", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1936:l00000556", condition()) - ) - ) - Block("1960:l000004d5", - statements( - LocalAssign(Register(R0, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1968:l00000451", condition()) - ) - ) - Block("1968:l00000451", - statements( - LocalAssign(Register(R0, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("2000:l000003f1", condition()) - ) - ) - Block("1936:l00000556", - statements( - ), - jumps( - GoTo("1988:l000003e2", condition()) - ) - ) - Block("1988:l000003e2", - statements( - LocalAssign(Register(R0, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("2000:l000003f1", condition()) - ) - ) - Block("2000:l000003f1", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1812:r", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1812:lr", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000030a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000595", condition()) - ) - ) - Block("1700:l00000595", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000030a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000005a8", condition()) - ) - ) - Block("1720:l0000030a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000005a8", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/switch2/gcc_O2/switch2-before-analysis.il.expected b/src/test/correct/switch2/gcc_O2/switch2-before-analysis.il.expected deleted file mode 100644 index af71c353c..000000000 --- a/src/test/correct/switch2/gcc_O2/switch2-before-analysis.il.expected +++ /dev/null @@ -1,311 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000331", condition()) - ) - ) - Block("1816:l00000331", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000033f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000358", condition()) - ) - ) - Block("1828:l00000358", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000033f", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000034b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f8", condition()) - ) - ) - Block("1852:l000002f8", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1896:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l00000540", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000222", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005fb", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000238", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003a8", condition()) - ) - ) - Block("1668:l00000238", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003a8", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000027d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000038a", condition()) - ) - ) - Block("1704:l0000038a", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l0000027d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l0000039d", condition()) - ) - ) - Block("1724:l0000027d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l0000039d", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1888:r", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1888:lr", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002b9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000036c", condition()) - ) - ) - Block("1764:l0000036c", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002b9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000037f", condition()) - ) - ) - Block("1784:l000002b9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000037f", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/switch2/gcc_no_plt_no_pic/switch2-before-analysis.il.expected b/src/test/correct/switch2/gcc_no_plt_no_pic/switch2-before-analysis.il.expected deleted file mode 100644 index ede52bf68..000000000 --- a/src/test/correct/switch2/gcc_no_plt_no_pic/switch2-before-analysis.il.expected +++ /dev/null @@ -1,502 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000ba8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000db9", condition()) - ) - ) - Block("1752:l00000db9", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000dc7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000de0", condition()) - ) - ) - Block("1764:l00000de0", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000dc7", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000dd3", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000ba8", condition()) - ) - ) - Block("1788:l00000ba8", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2012:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2012:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#14, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#14, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#14, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#14, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000fe5", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000ad2", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00001099", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000ae8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000e30", condition()) - ) - ) - Block("1604:l00000ae8", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000e30", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000b2d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000e12", condition()) - ) - ) - Block("1640:l00000e12", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000b2d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000e25", condition()) - ) - ) - Block("1660:l00000b2d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000e25", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1820:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1820:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1980:l00000c2f", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1852:l00000c67", condition()) - ) - ) - Block("1980:l00000c2f", - statements( - LocalAssign(Register(R0, bv64) := 4bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1988:l00000c41", condition()) - ) - ) - Block("1852:l00000c67", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1988:l00000c41", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("1864:l00000c8f", condition()) - ) - ) - Block("1864:l00000c8f", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#7, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#7, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1968:l00000cb0", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1876:l00000cc6", condition()) - ) - ) - Block("1876:l00000cc6", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#8, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#8, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1988:l00000c41", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("1888:l00000cee", condition()) - ) - ) - Block("1888:l00000cee", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#9, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#9, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1940:l00000d0f", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1900:l00000d41", condition()) - ) - ) - Block("1940:l00000d0f", - statements( - LocalAssign(Register(R30, bv64) := 1944bv64) - ), - jumps( - DirectCall("1812:r", condition()) - ) - ) - Block("1944:l00000d1b", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1948:l00000d23", condition()) - ) - ) - Block("1900:l00000d41", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#10, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#10, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1988:l00000c41", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("1912:l00000d69", condition()) - ) - ) - Block("1912:l00000d69", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#11, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#11, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1948:l00000d23", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1924:l00000d8f", condition()) - ) - ) - Block("1948:l00000d23", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("2000:l00000c50", condition()) - ) - ) - Block("1924:l00000d8f", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#12, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#12, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1960:l00000d34", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1936:l00000db5", condition()) - ) - ) - Block("1960:l00000d34", - statements( - LocalAssign(Register(R0, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1968:l00000cb0", condition()) - ) - ) - Block("1968:l00000cb0", - statements( - LocalAssign(Register(R0, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("2000:l00000c50", condition()) - ) - ) - Block("1936:l00000db5", - statements( - ), - jumps( - GoTo("1988:l00000c41", condition()) - ) - ) - Block("1988:l00000c41", - statements( - LocalAssign(Register(R0, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("2000:l00000c50", condition()) - ) - ) - Block("2000:l00000c50", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1812:r", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1812:lr", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000b69", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000df4", condition()) - ) - ) - Block("1700:l00000df4", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000b69", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000e07", condition()) - ) - ) - Block("1720:l00000b69", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000e07", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/switch2/gcc_pic/switch2-before-analysis.il.expected b/src/test/correct/switch2/gcc_pic/switch2-before-analysis.il.expected deleted file mode 100644 index ede52bf68..000000000 --- a/src/test/correct/switch2/gcc_pic/switch2-before-analysis.il.expected +++ /dev/null @@ -1,502 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000ba8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000db9", condition()) - ) - ) - Block("1752:l00000db9", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000dc7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000de0", condition()) - ) - ) - Block("1764:l00000de0", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000dc7", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000dd3", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000ba8", condition()) - ) - ) - Block("1788:l00000ba8", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2012:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2012:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#14, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#14, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#14, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#14, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000fe5", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000ad2", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00001099", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000ae8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000e30", condition()) - ) - ) - Block("1604:l00000ae8", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000e30", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000b2d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000e12", condition()) - ) - ) - Block("1640:l00000e12", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000b2d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000e25", condition()) - ) - ) - Block("1660:l00000b2d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000e25", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1820:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1820:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1980:l00000c2f", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1852:l00000c67", condition()) - ) - ) - Block("1980:l00000c2f", - statements( - LocalAssign(Register(R0, bv64) := 4bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1988:l00000c41", condition()) - ) - ) - Block("1852:l00000c67", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967290bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934587bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967291bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1988:l00000c41", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("1864:l00000c8f", condition()) - ) - ) - Block("1864:l00000c8f", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#7, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#7, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#7, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1968:l00000cb0", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1876:l00000cc6", condition()) - ) - ) - Block("1876:l00000cc6", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#8, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967291bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934588bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967292bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#8, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#8, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1988:l00000c41", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("1888:l00000cee", condition()) - ) - ) - Block("1888:l00000cee", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#9, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#9, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#9, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1940:l00000d0f", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1900:l00000d41", condition()) - ) - ) - Block("1940:l00000d0f", - statements( - LocalAssign(Register(R30, bv64) := 1944bv64) - ), - jumps( - DirectCall("1812:r", condition()) - ) - ) - Block("1944:l00000d1b", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1948:l00000d23", condition()) - ) - ) - Block("1900:l00000d41", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#10, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#10, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#10, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1988:l00000c41", condition(BinaryExpr("!=", BinaryExpr("and", BinaryExpr("comp", LocalVar(NF, bv1), LocalVar(VF, bv1)), BinaryExpr("comp", LocalVar(ZF, bv1), 0bv1)), 0bv1))) - GoTo("1912:l00000d69", condition()) - ) - ) - Block("1912:l00000d69", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#11, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#11, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#11, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1948:l00000d23", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1924:l00000d8f", condition()) - ) - ) - Block("1948:l00000d23", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("2000:l00000c50", condition()) - ) - ) - Block("1924:l00000d8f", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#12, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967293bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934590bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967294bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#12, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#12, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1960:l00000d34", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1936:l00000db5", condition()) - ) - ) - Block("1960:l00000d34", - statements( - LocalAssign(Register(R0, bv64) := 2bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1968:l00000cb0", condition()) - ) - ) - Block("1968:l00000cb0", - statements( - LocalAssign(Register(R0, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("2000:l00000c50", condition()) - ) - ) - Block("1936:l00000db5", - statements( - ), - jumps( - GoTo("1988:l00000c41", condition()) - ) - ) - Block("1988:l00000c41", - statements( - LocalAssign(Register(R0, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("2000:l00000c50", condition()) - ) - ) - Block("2000:l00000c50", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1812:r", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1812:lr", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000b69", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000df4", condition()) - ) - ) - Block("1700:l00000df4", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000b69", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000e07", condition()) - ) - ) - Block("1720:l00000b69", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000e07", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/syscall/clang/syscall-before-analysis.il.expected b/src/test/correct/syscall/clang/syscall-before-analysis.il.expected deleted file mode 100644 index 89ba9d357..000000000 --- a/src/test/correct/syscall/clang/syscall-before-analysis.il.expected +++ /dev/null @@ -1,325 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002b1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000341", condition()) - ) - ) - Block("1816:l00000341", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1840:l0000034f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000368", condition()) - ) - ) - Block("1828:l00000368", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000034f", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000035b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002b1", condition()) - ) - ) - Block("1852:l000002b1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1924:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1924:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1464:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1480bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1480:l0000056d", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001db", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1584:abort", condition()) - ) - ) - Block("?:l00000623", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1584:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l000001f1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003b8", condition()) - ) - ) - Block("1668:l000001f1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003b8", - statements( - ), - jumps( - GoTo("1568:l__gmon_start__", condition()) - ) - ) - Block("1568:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000236", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000039a", condition()) - ) - ) - Block("1704:l0000039a", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1724:l00000236", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003ad", condition()) - ) - ) - Block("1724:l00000236", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003ad", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1552:fork", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551608bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) - LocalAssign(Register(R30, bv64) := 1904bv64) - ), - jumps( - DirectCall("1552:fork", condition()) - ) - ) - Block("1904:l00000317", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000272", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000037c", condition()) - ) - ) - Block("1764:l0000037c", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l00000272", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000038f", condition()) - ) - ) - Block("1784:l00000272", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000038f", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/syscall/clang_no_plt_no_pic/syscall-before-analysis.il.expected b/src/test/correct/syscall/clang_no_plt_no_pic/syscall-before-analysis.il.expected deleted file mode 100644 index 7699f5ba7..000000000 --- a/src/test/correct/syscall/clang_no_plt_no_pic/syscall-before-analysis.il.expected +++ /dev/null @@ -1,325 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) - ), - jumps( - GoTo("1852:l000008c9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000959", condition()) - ) - ) - Block("1816:l00000959", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1840:l00000967", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000980", condition()) - ) - ) - Block("1828:l00000980", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000967", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000973", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000008c9", condition()) - ) - ) - Block("1852:l000008c9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1924:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1924:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1464:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1480bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1480:l00000b85", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000007f3", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1584:abort", condition()) - ) - ) - Block("?:l00000c17", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1584:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l00000809", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000009d0", condition()) - ) - ) - Block("1668:l00000809", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000009d0", - statements( - ), - jumps( - GoTo("1568:l__gmon_start__", condition()) - ) - ) - Block("1568:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000084e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000009b2", condition()) - ) - ) - Block("1704:l000009b2", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1724:l0000084e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000009c5", condition()) - ) - ) - Block("1724:l0000084e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000009c5", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1552:fork", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551608bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) - LocalAssign(Register(R30, bv64) := 1904bv64) - ), - jumps( - DirectCall("1552:fork", condition()) - ) - ) - Block("1904:l0000092f", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000088a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000994", condition()) - ) - ) - Block("1764:l00000994", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l0000088a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000009a7", condition()) - ) - ) - Block("1784:l0000088a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000009a7", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/syscall/clang_pic/syscall-before-analysis.il.expected b/src/test/correct/syscall/clang_pic/syscall-before-analysis.il.expected deleted file mode 100644 index 7699f5ba7..000000000 --- a/src/test/correct/syscall/clang_pic/syscall-before-analysis.il.expected +++ /dev/null @@ -1,325 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 56bv64)]), 56)) - ), - jumps( - GoTo("1852:l000008c9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000959", condition()) - ) - ) - Block("1816:l00000959", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1840:l00000967", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000980", condition()) - ) - ) - Block("1828:l00000980", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 48bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000967", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000973", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 56bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000008c9", condition()) - ) - ) - Block("1852:l000008c9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1924:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1924:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1464:l_init", - statements( - LocalAssign(LocalVar(#7, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#7, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#7, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#7, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1480bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1480:l00000b85", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000007f3", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1584:abort", condition()) - ) - ) - Block("?:l00000c17", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1584:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l00000809", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000009d0", condition()) - ) - ) - Block("1668:l00000809", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000009d0", - statements( - ), - jumps( - GoTo("1568:l__gmon_start__", condition()) - ) - ) - Block("1568:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 24bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 24bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000084e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000009b2", condition()) - ) - ) - Block("1704:l000009b2", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1724:l0000084e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000009c5", condition()) - ) - ) - Block("1724:l0000084e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000009c5", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1552:fork", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R29, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551612bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R29, bv64), 18446744073709551608bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) - LocalAssign(Register(R30, bv64) := 1904bv64) - ), - jumps( - DirectCall("1552:fork", condition()) - ) - ) - Block("1904:l0000092f", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [LocalVar(#5, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", LocalVar(#5, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 56bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000088a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000994", condition()) - ) - ) - Block("1764:l00000994", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l0000088a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000009a7", condition()) - ) - ) - Block("1784:l0000088a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000009a7", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/syscall/gcc/syscall-before-analysis.il.expected b/src/test/correct/syscall/gcc/syscall-before-analysis.il.expected deleted file mode 100644 index 83eb6010e..000000000 --- a/src/test/correct/syscall/gcc/syscall-before-analysis.il.expected +++ /dev/null @@ -1,323 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000326", condition()) - ) - ) - Block("1816:l00000326", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l00000334", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000034d", condition()) - ) - ) - Block("1828:l0000034d", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000334", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000340", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002a5", condition()) - ) - ) - Block("1852:l000002a5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1912:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1912:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1464:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1480bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1480:l0000054f", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001cf", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1584:abort", condition()) - ) - ) - Block("?:l00000602", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1584:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000039d", condition()) - ) - ) - Block("1668:l000001e5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000039d", - statements( - ), - jumps( - GoTo("1568:l__gmon_start__", condition()) - ) - ) - Block("1568:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000037f", condition()) - ) - ) - Block("1704:l0000037f", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000392", condition()) - ) - ) - Block("1724:l0000022a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000392", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1552:fork", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) - LocalAssign(Register(R30, bv64) := 1896bv64) - ), - jumps( - DirectCall("1552:fork", condition()) - ) - ) - Block("1896:l00000302", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 44bv64)]), 32)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000361", condition()) - ) - ) - Block("1764:l00000361", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000374", condition()) - ) - ) - Block("1784:l00000266", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000374", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/syscall/gcc_O2/syscall-before-analysis.il.expected b/src/test/correct/syscall/gcc_O2/syscall-before-analysis.il.expected deleted file mode 100644 index e0bcb88ac..000000000 --- a/src/test/correct/syscall/gcc_O2/syscall-before-analysis.il.expected +++ /dev/null @@ -1,294 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1856:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1856:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1916:l000002e4", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1880:l0000030d", condition()) - ) - ) - Block("1880:l0000030d", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1904:l0000031b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1892:l00000334", condition()) - ) - ) - Block("1892:l00000334", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1904bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1904:l0000031b", - statements( - LocalAssign(Register(R30, bv64) := 1908bv64) - ), - jumps( - DirectCall("1744:deregister_tm_clones", condition()) - ) - ) - Block("1908:l00000327", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1916:l000002e4", condition()) - ) - ) - Block("1916:l000002e4", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1940:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1940:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1464:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1480bv64) - ), - jumps( - DirectCall("1716:call_weak_fn", condition()) - ) - ) - Block("1480:l0000053d", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1712bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1712:l0000020e", - statements( - LocalAssign(Register(R30, bv64) := 1716bv64) - ), - jumps( - DirectCall("1584:abort", condition()) - ) - ) - Block("?:l000005f3", - statements( - ), - jumps( - DirectCall("1716:call_weak_fn", condition()) - ) - ) -)), -Procedure("1584:abort", in(), out(), blocks( -)), -Procedure("1716:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1716:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1732:l00000224", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1728:l00000384", condition()) - ) - ) - Block("1732:l00000224", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1728:l00000384", - statements( - ), - jumps( - GoTo("1568:l__gmon_start__", condition()) - ) - ) - Block("1568:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1744:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1744:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1788:l00000269", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1768:l00000366", condition()) - ) - ) - Block("1768:l00000366", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1788:l00000269", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1780:l00000379", condition()) - ) - ) - Block("1788:l00000269", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1780:l00000379", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1600:fork", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1936:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1936:lframe_dummy", - statements( - ), - jumps( - DirectCall("1792:register_tm_clones", condition()) - ) - ) -)), -Procedure("1792:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1848:l000002a5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000348", condition()) - ) - ) - Block("1828:l00000348", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1848:l000002a5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1840:l0000035b", condition()) - ) - ) - Block("1848:l000002a5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1840:l0000035b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/syscall/gcc_no_plt_no_pic/syscall-before-analysis.il.expected b/src/test/correct/syscall/gcc_no_plt_no_pic/syscall-before-analysis.il.expected deleted file mode 100644 index ee7bc2d9b..000000000 --- a/src/test/correct/syscall/gcc_no_plt_no_pic/syscall-before-analysis.il.expected +++ /dev/null @@ -1,323 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l0000089c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000091d", condition()) - ) - ) - Block("1816:l0000091d", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000092b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000944", condition()) - ) - ) - Block("1828:l00000944", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000092b", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000937", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l0000089c", condition()) - ) - ) - Block("1852:l0000089c", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1912:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1912:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1464:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1480bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1480:l00000b46", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000007c6", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1584:abort", condition()) - ) - ) - Block("?:l00000bd5", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1584:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l000007dc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000994", condition()) - ) - ) - Block("1668:l000007dc", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000994", - statements( - ), - jumps( - GoTo("1568:l__gmon_start__", condition()) - ) - ) - Block("1568:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000821", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000976", condition()) - ) - ) - Block("1704:l00000976", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000821", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000989", condition()) - ) - ) - Block("1724:l00000821", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000989", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1552:fork", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) - LocalAssign(Register(R30, bv64) := 1896bv64) - ), - jumps( - DirectCall("1552:fork", condition()) - ) - ) - Block("1896:l000008f9", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 44bv64)]), 32)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000958", condition()) - ) - ) - Block("1764:l00000958", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000096b", condition()) - ) - ) - Block("1784:l0000085d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000096b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/syscall/gcc_pic/syscall-before-analysis.il.expected b/src/test/correct/syscall/gcc_pic/syscall-before-analysis.il.expected deleted file mode 100644 index ee7bc2d9b..000000000 --- a/src/test/correct/syscall/gcc_pic/syscall-before-analysis.il.expected +++ /dev/null @@ -1,323 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l0000089c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000091d", condition()) - ) - ) - Block("1816:l0000091d", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000092b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000944", condition()) - ) - ) - Block("1828:l00000944", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000092b", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000937", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l0000089c", condition()) - ) - ) - Block("1852:l0000089c", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1912:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1912:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1464:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1464:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1480bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1480:l00000b46", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000007c6", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1584:abort", condition()) - ) - ) - Block("?:l00000bd5", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1584:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l000007dc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000994", condition()) - ) - ) - Block("1668:l000007dc", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000994", - statements( - ), - jumps( - GoTo("1568:l__gmon_start__", condition()) - ) - ) - Block("1568:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000821", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000976", condition()) - ) - ) - Block("1704:l00000976", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000821", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000989", condition()) - ) - ) - Block("1724:l00000821", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000989", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1552:fork", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551568bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R1, bv64))) - LocalAssign(Register(R30, bv64) := 1896bv64) - ), - jumps( - DirectCall("1552:fork", condition()) - ) - ) - Block("1896:l000008f9", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 44bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 44bv64)]), 32)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 48bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000958", condition()) - ) - ) - Block("1764:l00000958", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l0000085d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000096b", condition()) - ) - ) - Block("1784:l0000085d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000096b", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/using_gamma_conditional/clang/using_gamma_conditional-before-analysis.il.expected b/src/test/correct/using_gamma_conditional/clang/using_gamma_conditional-before-analysis.il.expected deleted file mode 100644 index d315cf902..000000000 --- a/src/test/correct/using_gamma_conditional/clang/using_gamma_conditional-before-analysis.il.expected +++ /dev/null @@ -1,369 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002c1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000367", condition()) - ) - ) - Block("1752:l00000367", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000375", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000038e", condition()) - ) - ) - Block("1764:l0000038e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000375", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000381", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002c1", condition()) - ) - ) - Block("1788:l000002c1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000571", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001eb", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000626", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000201", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003de", condition()) - ) - ) - Block("1604:l00000201", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003de", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003c0", condition()) - ) - ) - Block("1640:l000003c0", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003d3", condition()) - ) - ) - Block("1660:l00000246", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003d3", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000322", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("?:l00000325", condition()) - ) - ) - Block("?:l00000325", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000328", condition()) - ) - ) - Block("?:l00000322", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000328", condition()) - ) - ) - Block("?:l00000328", - statements( - ), - jumps( - GoTo("1852:l00000330", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1840:l00000358", condition()) - ) - ) - Block("1852:l00000330", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1864:l00000343", condition()) - ) - ) - Block("1840:l00000358", - statements( - ), - jumps( - GoTo("1844:l00000359", condition()) - ) - ) - Block("1844:l00000359", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - ), - jumps( - GoTo("1864:l00000343", condition()) - ) - ) - Block("1864:l00000343", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003a2", condition()) - ) - ) - Block("1700:l000003a2", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003b5", condition()) - ) - ) - Block("1720:l00000282", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003b5", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/using_gamma_conditional/clang_O2/using_gamma_conditional-before-analysis.il.expected b/src/test/correct/using_gamma_conditional/clang_O2/using_gamma_conditional-before-analysis.il.expected deleted file mode 100644 index dcaa079e2..000000000 --- a/src/test/correct/using_gamma_conditional/clang_O2/using_gamma_conditional-before-analysis.il.expected +++ /dev/null @@ -1,332 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002f6", condition()) - ) - ) - Block("1752:l000002f6", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000304", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000031d", condition()) - ) - ) - Block("1764:l0000031d", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000304", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000310", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000295", condition()) - ) - ) - Block("1788:l00000295", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1832:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004f5", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001bf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000059e", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000036d", condition()) - ) - ) - Block("1604:l000001d5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000036d", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000034f", condition()) - ) - ) - Block("1640:l0000034f", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000362", condition()) - ) - ) - Block("1660:l0000021a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000362", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("?:l000002e5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("?:l000002e8", condition()) - ) - ) - Block("?:l000002e8", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - ), - jumps( - GoTo("?:l000002eb", condition()) - ) - ) - Block("?:l000002e5", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - GoTo("?:l000002eb", condition()) - ) - ) - Block("?:l000002eb", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000331", condition()) - ) - ) - Block("1700:l00000331", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000344", condition()) - ) - ) - Block("1720:l00000256", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000344", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/using_gamma_conditional/clang_no_plt_no_pic/using_gamma_conditional-before-analysis.il.expected b/src/test/correct/using_gamma_conditional/clang_no_plt_no_pic/using_gamma_conditional-before-analysis.il.expected deleted file mode 100644 index aa395bb43..000000000 --- a/src/test/correct/using_gamma_conditional/clang_no_plt_no_pic/using_gamma_conditional-before-analysis.il.expected +++ /dev/null @@ -1,369 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008dc", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000982", condition()) - ) - ) - Block("1752:l00000982", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000990", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009a9", condition()) - ) - ) - Block("1764:l000009a9", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000990", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000099c", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008dc", condition()) - ) - ) - Block("1788:l000008dc", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b8c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000806", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c1e", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000081c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000009f9", condition()) - ) - ) - Block("1604:l0000081c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000009f9", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000861", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009db", condition()) - ) - ) - Block("1640:l000009db", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000861", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009ee", condition()) - ) - ) - Block("1660:l00000861", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009ee", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l0000093d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("?:l00000940", condition()) - ) - ) - Block("?:l00000940", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000943", condition()) - ) - ) - Block("?:l0000093d", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000943", condition()) - ) - ) - Block("?:l00000943", - statements( - ), - jumps( - GoTo("1852:l0000094b", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1840:l00000973", condition()) - ) - ) - Block("1852:l0000094b", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1864:l0000095e", condition()) - ) - ) - Block("1840:l00000973", - statements( - ), - jumps( - GoTo("1844:l00000974", condition()) - ) - ) - Block("1844:l00000974", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - ), - jumps( - GoTo("1864:l0000095e", condition()) - ) - ) - Block("1864:l0000095e", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000089d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009bd", condition()) - ) - ) - Block("1700:l000009bd", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000089d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009d0", condition()) - ) - ) - Block("1720:l0000089d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009d0", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/using_gamma_conditional/clang_pic/using_gamma_conditional-before-analysis.il.expected b/src/test/correct/using_gamma_conditional/clang_pic/using_gamma_conditional-before-analysis.il.expected deleted file mode 100644 index 55fcc00a4..000000000 --- a/src/test/correct/using_gamma_conditional/clang_pic/using_gamma_conditional-before-analysis.il.expected +++ /dev/null @@ -1,370 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000372", condition()) - ) - ) - Block("1816:l00000372", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) - ), - jumps( - GoTo("1840:l00000380", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000399", condition()) - ) - ) - Block("1828:l00000399", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000380", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000038c", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002c5", condition()) - ) - ) - Block("1852:l000002c5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1944:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l00000520", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001ef", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l000005d6", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003e9", condition()) - ) - ) - Block("1668:l00000205", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003e9", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003cb", condition()) - ) - ) - Block("1704:l000003cb", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003de", condition()) - ) - ) - Block("1724:l0000024a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003de", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4040bv64)])) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l0000032d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("?:l00000330", condition()) - ) - ) - Block("?:l00000330", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000333", condition()) - ) - ) - Block("?:l0000032d", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000333", condition()) - ) - ) - Block("?:l00000333", - statements( - ), - jumps( - GoTo("1920:l0000033b", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1908:l00000363", condition()) - ) - ) - Block("1920:l0000033b", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1932:l0000034e", condition()) - ) - ) - Block("1908:l00000363", - statements( - ), - jumps( - GoTo("1912:l00000364", condition()) - ) - ) - Block("1912:l00000364", - statements( - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - ), - jumps( - GoTo("1932:l0000034e", condition()) - ) - ) - Block("1932:l0000034e", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003ad", condition()) - ) - ) - Block("1764:l000003ad", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003c0", condition()) - ) - ) - Block("1784:l00000286", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003c0", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/using_gamma_conditional/gcc/using_gamma_conditional-before-analysis.il.expected b/src/test/correct/using_gamma_conditional/gcc/using_gamma_conditional-before-analysis.il.expected deleted file mode 100644 index 321ef1837..000000000 --- a/src/test/correct/using_gamma_conditional/gcc/using_gamma_conditional-before-analysis.il.expected +++ /dev/null @@ -1,333 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000312", condition()) - ) - ) - Block("1752:l00000312", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000320", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000339", condition()) - ) - ) - Block("1764:l00000339", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000320", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000032c", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002a5", condition()) - ) - ) - Block("1788:l000002a5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1848:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000515", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001cf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005c4", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000389", condition()) - ) - ) - Block("1604:l000001e5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000389", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000036b", condition()) - ) - ) - Block("1640:l0000036b", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000037e", condition()) - ) - ) - Block("1660:l0000022a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000037e", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1840:l000002fa", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1832:l00000309", condition()) - ) - ) - Block("1840:l000002fa", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - ), - jumps( - GoTo("1844:l00000304", condition()) - ) - ) - Block("1832:l00000309", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - GoTo("1844:l00000304", condition()) - ) - ) - Block("1844:l00000304", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000034d", condition()) - ) - ) - Block("1700:l0000034d", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000360", condition()) - ) - ) - Block("1720:l00000266", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000360", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/using_gamma_conditional/gcc_O2/using_gamma_conditional-before-analysis.il.expected b/src/test/correct/using_gamma_conditional/gcc_O2/using_gamma_conditional-before-analysis.il.expected deleted file mode 100644 index 05a442bf5..000000000 --- a/src/test/correct/using_gamma_conditional/gcc_O2/using_gamma_conditional-before-analysis.il.expected +++ /dev/null @@ -1,332 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l0000030f", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000338", condition()) - ) - ) - Block("1816:l00000338", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l00000346", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000035f", condition()) - ) - ) - Block("1828:l0000035f", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000346", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000352", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l0000030f", condition()) - ) - ) - Block("1852:l0000030f", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l00000542", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000239", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005f6", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l0000024f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003af", condition()) - ) - ) - Block("1668:l0000024f", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003af", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000294", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000391", condition()) - ) - ) - Block("1704:l00000391", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000294", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003a4", condition()) - ) - ) - Block("1724:l00000294", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003a4", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 20bv64)]), 32)) - LocalAssign(LocalVar(#1, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#1, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#1, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#1, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#1, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("?:l000001cf", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("?:l000001d2", condition()) - ) - ) - Block("?:l000001d2", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - ), - jumps( - GoTo("?:l000001d5", condition()) - ) - ) - Block("?:l000001cf", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - GoTo("?:l000001d5", condition()) - ) - ) - Block("?:l000001d5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002d0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000373", condition()) - ) - ) - Block("1764:l00000373", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002d0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000386", condition()) - ) - ) - Block("1784:l000002d0", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000386", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/using_gamma_conditional/gcc_no_plt_no_pic/using_gamma_conditional-before-analysis.il.expected b/src/test/correct/using_gamma_conditional/gcc_no_plt_no_pic/using_gamma_conditional-before-analysis.il.expected deleted file mode 100644 index c9886d0e2..000000000 --- a/src/test/correct/using_gamma_conditional/gcc_no_plt_no_pic/using_gamma_conditional-before-analysis.il.expected +++ /dev/null @@ -1,333 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000085e", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000008cb", condition()) - ) - ) - Block("1752:l000008cb", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000008d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000008f2", condition()) - ) - ) - Block("1764:l000008f2", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000008d9", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000008e5", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000085e", condition()) - ) - ) - Block("1788:l0000085e", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1848:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1848:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000ace", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000788", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000b59", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l0000079e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000942", condition()) - ) - ) - Block("1604:l0000079e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000942", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000007e3", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000924", condition()) - ) - ) - Block("1640:l00000924", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l000007e3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000937", condition()) - ) - ) - Block("1660:l000007e3", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000937", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1840:l000008b3", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1832:l000008c2", condition()) - ) - ) - Block("1840:l000008b3", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - ), - jumps( - GoTo("1844:l000008bd", condition()) - ) - ) - Block("1832:l000008c2", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - GoTo("1844:l000008bd", condition()) - ) - ) - Block("1844:l000008bd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000081f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000906", condition()) - ) - ) - Block("1700:l00000906", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000081f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000919", condition()) - ) - ) - Block("1720:l0000081f", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000919", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/using_gamma_conditional/gcc_pic/using_gamma_conditional-before-analysis.il.expected b/src/test/correct/using_gamma_conditional/gcc_pic/using_gamma_conditional-before-analysis.il.expected deleted file mode 100644 index c8a64ef97..000000000 --- a/src/test/correct/using_gamma_conditional/gcc_pic/using_gamma_conditional-before-analysis.il.expected +++ /dev/null @@ -1,333 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002a5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000313", condition()) - ) - ) - Block("1816:l00000313", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - ), - jumps( - GoTo("1840:l00000321", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000033a", condition()) - ) - ) - Block("1828:l0000033a", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000321", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000032d", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002a5", condition()) - ) - ) - Block("1852:l000002a5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1912:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1912:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l000004c1", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001cf", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l00000570", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l000001e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000038a", condition()) - ) - ) - Block("1668:l000001e5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000038a", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000036c", condition()) - ) - ) - Block("1704:l0000036c", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) - ), - jumps( - GoTo("1724:l0000022a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l0000037f", condition()) - ) - ) - Block("1724:l0000022a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l0000037f", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1904:l000002fb", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1896:l0000030a", condition()) - ) - ) - Block("1904:l000002fb", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - ), - jumps( - GoTo("1908:l00000305", condition()) - ) - ) - Block("1896:l0000030a", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - GoTo("1908:l00000305", condition()) - ) - ) - Block("1908:l00000305", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000034e", condition()) - ) - ) - Block("1764:l0000034e", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l00000266", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000361", condition()) - ) - ) - Block("1784:l00000266", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000361", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/using_gamma_write_z/clang/using_gamma_write_z-before-analysis.il.expected b/src/test/correct/using_gamma_write_z/clang/using_gamma_write_z-before-analysis.il.expected deleted file mode 100644 index 8a23eadb8..000000000 --- a/src/test/correct/using_gamma_write_z/clang/using_gamma_write_z-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002da", condition()) - ) - ) - Block("1752:l000002da", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000301", condition()) - ) - ) - Block("1764:l00000301", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002e8", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002f4", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000295", condition()) - ) - ) - Block("1788:l00000295", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1832:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004d9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001bf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000582", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000351", condition()) - ) - ) - Block("1604:l000001d5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000351", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000333", condition()) - ) - ) - Block("1640:l00000333", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000346", condition()) - ) - ) - Block("1660:l0000021a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000346", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000315", condition()) - ) - ) - Block("1700:l00000315", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000328", condition()) - ) - ) - Block("1720:l00000256", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000328", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/using_gamma_write_z/clang_O2/using_gamma_write_z-before-analysis.il.expected b/src/test/correct/using_gamma_write_z/clang_O2/using_gamma_write_z-before-analysis.il.expected deleted file mode 100644 index e47151e8a..000000000 --- a/src/test/correct/using_gamma_write_z/clang_O2/using_gamma_write_z-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000295", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002da", condition()) - ) - ) - Block("1752:l000002da", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002e8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000301", condition()) - ) - ) - Block("1764:l00000301", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002e8", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002f4", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000295", condition()) - ) - ) - Block("1788:l00000295", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1832:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004d9", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001bf", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000582", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000351", condition()) - ) - ) - Block("1604:l000001d5", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000351", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000333", condition()) - ) - ) - Block("1640:l00000333", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000346", condition()) - ) - ) - Block("1660:l0000021a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000346", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 1bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000315", condition()) - ) - ) - Block("1700:l00000315", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000256", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000328", condition()) - ) - ) - Block("1720:l00000256", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000328", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/using_gamma_write_z/clang_no_plt_no_pic/using_gamma_write_z-before-analysis.il.expected b/src/test/correct/using_gamma_write_z/clang_no_plt_no_pic/using_gamma_write_z-before-analysis.il.expected deleted file mode 100644 index 37424e6b7..000000000 --- a/src/test/correct/using_gamma_write_z/clang_no_plt_no_pic/using_gamma_write_z-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000080c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000851", condition()) - ) - ) - Block("1752:l00000851", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000085f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000878", condition()) - ) - ) - Block("1764:l00000878", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000085f", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000086b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000080c", condition()) - ) - ) - Block("1788:l0000080c", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1832:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1832:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000a50", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000736", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000ad7", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l0000074c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000008c8", condition()) - ) - ) - Block("1604:l0000074c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000008c8", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000008aa", condition()) - ) - ) - Block("1640:l000008aa", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000791", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000008bd", condition()) - ) - ) - Block("1660:l00000791", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000008bd", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 52bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000088c", condition()) - ) - ) - Block("1700:l0000088c", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000007cd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000089f", condition()) - ) - ) - Block("1720:l000007cd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000089f", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/using_gamma_write_z/clang_pic/using_gamma_write_z-before-analysis.il.expected b/src/test/correct/using_gamma_write_z/clang_pic/using_gamma_write_z-before-analysis.il.expected deleted file mode 100644 index bba5c8aee..000000000 --- a/src/test/correct/using_gamma_write_z/clang_pic/using_gamma_write_z-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000002e5", condition()) - ) - ) - Block("1816:l000002e5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4032bv64)])) - ), - jumps( - GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000030c", condition()) - ) - ) - Block("1828:l0000030c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l000002f3", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000002ff", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l00000299", condition()) - ) - ) - Block("1852:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1900:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l00000493", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l0000053d", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000035c", condition()) - ) - ) - Block("1668:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000035c", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000033e", condition()) - ) - ) - Block("1704:l0000033e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4024bv64)])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000351", condition()) - ) - ) - Block("1724:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000351", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4040bv64)])) - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000320", condition()) - ) - ) - Block("1764:l00000320", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000333", condition()) - ) - ) - Block("1784:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000333", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/using_gamma_write_z/gcc/using_gamma_write_z-before-analysis.il.expected b/src/test/correct/using_gamma_write_z/gcc/using_gamma_write_z-before-analysis.il.expected deleted file mode 100644 index 28b23d5f7..000000000 --- a/src/test/correct/using_gamma_write_z/gcc/using_gamma_write_z-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002e4", condition()) - ) - ) - Block("1752:l000002e4", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000002f2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000030b", condition()) - ) - ) - Block("1764:l0000030b", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002f2", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002fe", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000299", condition()) - ) - ) - Block("1788:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004e4", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000058e", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000035b", condition()) - ) - ) - Block("1604:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000035b", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000033d", condition()) - ) - ) - Block("1640:l0000033d", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000350", condition()) - ) - ) - Block("1660:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000350", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000031f", condition()) - ) - ) - Block("1700:l0000031f", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000332", condition()) - ) - ) - Block("1720:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000332", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/using_gamma_write_z/gcc_O2/using_gamma_write_z-before-analysis.il.expected b/src/test/correct/using_gamma_write_z/gcc_O2/using_gamma_write_z-before-analysis.il.expected deleted file mode 100644 index bebedbe2b..000000000 --- a/src/test/correct/using_gamma_write_z/gcc_O2/using_gamma_write_z-before-analysis.il.expected +++ /dev/null @@ -1,305 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f3", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000031c", condition()) - ) - ) - Block("1816:l0000031c", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000032a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000343", condition()) - ) - ) - Block("1828:l00000343", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000032a", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000336", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f3", condition()) - ) - ) - Block("1852:l000002f3", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l00000526", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l0000021d", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005da", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000233", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000393", condition()) - ) - ) - Block("1668:l00000233", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000393", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000375", condition()) - ) - ) - Block("1704:l00000375", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000278", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000388", condition()) - ) - ) - Block("1724:l00000278", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000388", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R2, bv64) := 1bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R2, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000357", condition()) - ) - ) - Block("1764:l00000357", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002b4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000036a", condition()) - ) - ) - Block("1784:l000002b4", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000036a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/using_gamma_write_z/gcc_no_plt_no_pic/using_gamma_write_z-before-analysis.il.expected b/src/test/correct/using_gamma_write_z/gcc_no_plt_no_pic/using_gamma_write_z-before-analysis.il.expected deleted file mode 100644 index d319879d6..000000000 --- a/src/test/correct/using_gamma_write_z/gcc_no_plt_no_pic/using_gamma_write_z-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l0000081c", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000867", condition()) - ) - ) - Block("1752:l00000867", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000875", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000088e", condition()) - ) - ) - Block("1764:l0000088e", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000875", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000881", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l0000081c", condition()) - ) - ) - Block("1788:l0000081c", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000a67", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000746", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000aef", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l0000075c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000008de", condition()) - ) - ) - Block("1604:l0000075c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000008de", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000008c0", condition()) - ) - ) - Block("1640:l000008c0", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l000007a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000008d3", condition()) - ) - ) - Block("1660:l000007a1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000008d3", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000008a2", condition()) - ) - ) - Block("1700:l000008a2", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000007dd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000008b5", condition()) - ) - ) - Block("1720:l000007dd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000008b5", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/correct/using_gamma_write_z/gcc_pic/using_gamma_write_z-before-analysis.il.expected b/src/test/correct/using_gamma_write_z/gcc_pic/using_gamma_write_z-before-analysis.il.expected deleted file mode 100644 index da93bfeeb..000000000 --- a/src/test/correct/using_gamma_write_z/gcc_pic/using_gamma_write_z-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1504:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000002e5", condition()) - ) - ) - Block("1816:l000002e5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - ), - jumps( - GoTo("1840:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000030c", condition()) - ) - ) - Block("1828:l0000030c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1504:__cxa_finalize", condition()) - ) - ) - Block("1840:l000002f3", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000002ff", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l00000299", condition()) - ) - ) - Block("1852:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1488:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1488:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1900:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1900:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1432:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1432:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1448bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1448:l00000493", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1488:__libc_start_main", condition()) - ) - ) - Block("1648:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1536:abort", condition()) - ) - ) - Block("?:l0000053d", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1536:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000035c", condition()) - ) - ) - Block("1668:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000035c", - statements( - ), - jumps( - GoTo("1520:l__gmon_start__", condition()) - ) - ) - Block("1520:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4024bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4024bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000033e", condition()) - ) - ) - Block("1704:l0000033e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4048bv64)])) - ), - jumps( - GoTo("1724:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000351", condition()) - ) - ) - Block("1724:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000351", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R1, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000320", condition()) - ) - ) - Block("1764:l00000320", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000333", condition()) - ) - ) - Block("1784:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000333", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign/clang/basicassign-before-analysis.il.expected b/src/test/incorrect/basicassign/clang/basicassign-before-analysis.il.expected deleted file mode 100644 index 27524afe5..000000000 --- a/src/test/incorrect/basicassign/clang/basicassign-before-analysis.il.expected +++ /dev/null @@ -1,314 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002b9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000033e", condition()) - ) - ) - Block("1752:l0000033e", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000034c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000365", condition()) - ) - ) - Block("1764:l00000365", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000034c", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000358", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002b9", condition()) - ) - ) - Block("1788:l000002b9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1868:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1868:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000546", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001e3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005d6", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001f9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003b5", condition()) - ) - ) - Block("1604:l000001f9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003b5", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000397", condition()) - ) - ) - Block("1640:l00000397", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000023e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003aa", condition()) - ) - ) - Block("1660:l0000023e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003aa", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R10, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R10, bv64), 52bv64)]), 32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := Extract(Register(R9, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) - LocalAssign(Register(R11, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) - LocalAssign(Register(R9, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 60bv64)] := Extract(Register(R11, bv64)[32:0]))) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R10, bv64), 52bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := Extract(Register(R10, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 60bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000379", condition()) - ) - ) - Block("1700:l00000379", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000038c", condition()) - ) - ) - Block("1720:l0000027a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000038c", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign/clang_O2/basicassign-before-analysis.il.expected b/src/test/incorrect/basicassign/clang_O2/basicassign-before-analysis.il.expected deleted file mode 100644 index cadb95178..000000000 --- a/src/test/incorrect/basicassign/clang_O2/basicassign-before-analysis.il.expected +++ /dev/null @@ -1,308 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002a1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002fa", condition()) - ) - ) - Block("1752:l000002fa", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000308", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000321", condition()) - ) - ) - Block("1764:l00000321", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000308", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000314", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002a1", condition()) - ) - ) - Block("1788:l000002a1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1844:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1844:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004fc", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001cb", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000586", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001e1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000371", condition()) - ) - ) - Block("1604:l000001e1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000371", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000353", condition()) - ) - ) - Block("1640:l00000353", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000226", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000366", condition()) - ) - ) - Block("1660:l00000226", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000366", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R10, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R10, bv64), 60bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000335", condition()) - ) - ) - Block("1700:l00000335", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000262", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000348", condition()) - ) - ) - Block("1720:l00000262", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000348", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign/clang_no_plt_no_pic/basicassign-before-analysis.il.expected b/src/test/incorrect/basicassign/clang_no_plt_no_pic/basicassign-before-analysis.il.expected deleted file mode 100644 index fadb39eff..000000000 --- a/src/test/incorrect/basicassign/clang_no_plt_no_pic/basicassign-before-analysis.il.expected +++ /dev/null @@ -1,314 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008a6", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000092b", condition()) - ) - ) - Block("1752:l0000092b", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000939", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000952", condition()) - ) - ) - Block("1764:l00000952", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000939", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000945", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008a6", condition()) - ) - ) - Block("1788:l000008a6", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1868:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1868:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b33", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007d0", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000bc3", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000007e6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000009a2", condition()) - ) - ) - Block("1604:l000007e6", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000009a2", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000082b", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000984", condition()) - ) - ) - Block("1640:l00000984", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000082b", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000997", condition()) - ) - ) - Block("1660:l0000082b", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000997", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R10, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R10, bv64), 52bv64)]), 32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := Extract(Register(R9, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := 0bv32)) - LocalAssign(Register(R11, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) - LocalAssign(Register(R9, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 60bv64)] := Extract(Register(R11, bv64)[32:0]))) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R10, bv64), 52bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 56bv64)] := Extract(Register(R10, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 60bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000867", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000966", condition()) - ) - ) - Block("1700:l00000966", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000867", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000979", condition()) - ) - ) - Block("1720:l00000867", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000979", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign/clang_pic/basicassign-before-analysis.il.expected b/src/test/incorrect/basicassign/clang_pic/basicassign-before-analysis.il.expected deleted file mode 100644 index 05540e258..000000000 --- a/src/test/incorrect/basicassign/clang_pic/basicassign-before-analysis.il.expected +++ /dev/null @@ -1,317 +0,0 @@ -Procedure("1552:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000035f", condition()) - ) - ) - Block("1816:l0000035f", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4016bv64)])) - ), - jumps( - GoTo("1840:l0000036d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000386", condition()) - ) - ) - Block("1828:l00000386", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1552:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000036d", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000379", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002c5", condition()) - ) - ) - Block("1852:l000002c5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1944:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1480:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1480:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1496bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1496:l0000056a", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1536:__libc_start_main", condition()) - ) - ) - Block("1648:l000001ef", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1584:abort", condition()) - ) - ) - Block("?:l0000061f", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1584:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003d6", condition()) - ) - ) - Block("1668:l00000205", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003d6", - statements( - ), - jumps( - GoTo("1568:l__gmon_start__", condition()) - ) - ) - Block("1568:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003b8", condition()) - ) - ) - Block("1704:l000003b8", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4008bv64)])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003cb", condition()) - ) - ) - Block("1724:l0000024a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003cb", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) - LocalAssign(Register(R10, bv64) := 65536bv64) - LocalAssign(Register(R10, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R10, bv64), 4048bv64)])) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R10, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R9, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := 0bv32)) - LocalAssign(Register(R11, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4024bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R11, bv64)[32:0]))) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R10, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R10, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000039a", condition()) - ) - ) - Block("1764:l0000039a", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003ad", condition()) - ) - ) - Block("1784:l00000286", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003ad", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign/gcc/basicassign-before-analysis.il.expected b/src/test/incorrect/basicassign/gcc/basicassign-before-analysis.il.expected deleted file mode 100644 index 81fad0754..000000000 --- a/src/test/incorrect/basicassign/gcc/basicassign-before-analysis.il.expected +++ /dev/null @@ -1,329 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002f5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000003ce", condition()) - ) - ) - Block("1752:l000003ce", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000003dc", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003f5", condition()) - ) - ) - Block("1764:l000003f5", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000003dc", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000003e8", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002f5", condition()) - ) - ) - Block("1788:l000002f5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1928:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1928:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000005e5", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000021f", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000684", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000235", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000445", condition()) - ) - ) - Block("1604:l00000235", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000445", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000427", condition()) - ) - ) - Block("1640:l00000427", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000043a", condition()) - ) - ) - Block("1660:l0000027a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000043a", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 28bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 28bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000002b6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000409", condition()) - ) - ) - Block("1700:l00000409", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000002b6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000041c", condition()) - ) - ) - Block("1720:l000002b6", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000041c", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign/gcc_O2/basicassign-before-analysis.il.expected b/src/test/incorrect/basicassign/gcc_O2/basicassign-before-analysis.il.expected deleted file mode 100644 index 0e11b8b11..000000000 --- a/src/test/incorrect/basicassign/gcc_O2/basicassign-before-analysis.il.expected +++ /dev/null @@ -1,308 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#4, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#4, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#4, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#4, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l00000303", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000032c", condition()) - ) - ) - Block("1816:l0000032c", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l0000033a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000353", condition()) - ) - ) - Block("1828:l00000353", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000033a", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000346", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l00000303", condition()) - ) - ) - Block("1852:l00000303", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l00000536", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l0000022d", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005c8", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000243", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003a3", condition()) - ) - ) - Block("1668:l00000243", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003a3", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#2, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#2, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#3, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#3, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000288", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000385", condition()) - ) - ) - Block("1704:l00000385", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l00000288", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000398", condition()) - ) - ) - Block("1724:l00000288", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000398", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R2, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R2, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 20bv64)]), 32)) - LocalAssign(LocalVar(#1, bv64) := BinaryExpr("add", Register(R1, bv64), 4bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#1, bv64)] := Extract(Register(R2, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#1, bv64), 4bv64)] := Extract(Register(R2, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002c4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000367", condition()) - ) - ) - Block("1764:l00000367", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002c4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l0000037a", condition()) - ) - ) - Block("1784:l000002c4", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l0000037a", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign/gcc_no_plt_no_pic/basicassign-before-analysis.il.expected b/src/test/incorrect/basicassign/gcc_no_plt_no_pic/basicassign-before-analysis.il.expected deleted file mode 100644 index 3e36ba495..000000000 --- a/src/test/incorrect/basicassign/gcc_no_plt_no_pic/basicassign-before-analysis.il.expected +++ /dev/null @@ -1,329 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000990", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000a69", condition()) - ) - ) - Block("1752:l00000a69", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000a77", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000a90", condition()) - ) - ) - Block("1764:l00000a90", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000a77", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000a83", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000990", condition()) - ) - ) - Block("1788:l00000990", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1928:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1928:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000c80", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000008ba", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000d1f", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000008d0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000ae0", condition()) - ) - ) - Block("1604:l000008d0", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000ae0", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000915", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000ac2", condition()) - ) - ) - Block("1640:l00000ac2", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000915", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000ad5", condition()) - ) - ) - Block("1660:l00000915", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000ad5", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 28bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 28bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000951", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000aa4", condition()) - ) - ) - Block("1700:l00000aa4", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000951", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000ab7", condition()) - ) - ) - Block("1720:l00000951", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000ab7", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign/gcc_pic/basicassign-before-analysis.il.expected b/src/test/incorrect/basicassign/gcc_pic/basicassign-before-analysis.il.expected deleted file mode 100644 index bcee17e63..000000000 --- a/src/test/incorrect/basicassign/gcc_pic/basicassign-before-analysis.il.expected +++ /dev/null @@ -1,329 +0,0 @@ -Procedure("1552:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l000003d7", condition()) - ) - ) - Block("1816:l000003d7", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1840:l000003e5", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l000003fe", condition()) - ) - ) - Block("1828:l000003fe", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1552:__cxa_finalize", condition()) - ) - ) - Block("1840:l000003e5", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000003f1", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f5", condition()) - ) - ) - Block("1852:l000002f5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 3992bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 3992bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1992:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1992:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1480:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1480:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1496bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1496:l000005ee", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1536:__libc_start_main", condition()) - ) - ) - Block("1648:l0000021f", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1584:abort", condition()) - ) - ) - Block("?:l000006af", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1584:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1668:l00000235", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000044e", condition()) - ) - ) - Block("1668:l00000235", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000044e", - statements( - ), - jumps( - GoTo("1568:l__gmon_start__", condition()) - ) - ) - Block("1568:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4008bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4008bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l00000430", condition()) - ) - ) - Block("1704:l00000430", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1724:l0000027a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000443", condition()) - ) - ) - Block("1724:l0000027a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000443", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002b6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000412", condition()) - ) - ) - Block("1764:l00000412", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002b6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000425", condition()) - ) - ) - Block("1784:l000002b6", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000425", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign1/clang/basicassign1-before-analysis.il.expected b/src/test/incorrect/basicassign1/clang/basicassign1-before-analysis.il.expected deleted file mode 100644 index 7a0c2aa40..000000000 --- a/src/test/incorrect/basicassign1/clang/basicassign1-before-analysis.il.expected +++ /dev/null @@ -1,315 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000349", condition()) - ) - ) - Block("1752:l00000349", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000357", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000370", condition()) - ) - ) - Block("1764:l00000370", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000357", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000363", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002bd", condition()) - ) - ) - Block("1788:l000002bd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000552", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001e7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005e3", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003c0", condition()) - ) - ) - Block("1604:l000001fd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003c0", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003a2", condition()) - ) - ) - Block("1640:l000003a2", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003b5", condition()) - ) - ) - Block("1660:l00000242", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003b5", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R9, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R9, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R10, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000384", condition()) - ) - ) - Block("1700:l00000384", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000397", condition()) - ) - ) - Block("1720:l0000027e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000397", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign1/clang_O2/basicassign1-before-analysis.il.expected b/src/test/incorrect/basicassign1/clang_O2/basicassign1-before-analysis.il.expected deleted file mode 100644 index 09a3b4428..000000000 --- a/src/test/incorrect/basicassign1/clang_O2/basicassign1-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002e5", condition()) - ) - ) - Block("1752:l000002e5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000030c", condition()) - ) - ) - Block("1764:l0000030c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002f3", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002ff", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000299", condition()) - ) - ) - Block("1788:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004e5", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000056d", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000035c", condition()) - ) - ) - Block("1604:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000035c", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000033e", condition()) - ) - ) - Block("1640:l0000033e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000351", condition()) - ) - ) - Block("1660:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000351", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000320", condition()) - ) - ) - Block("1700:l00000320", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000333", condition()) - ) - ) - Block("1720:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000333", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign1/clang_no_plt_no_pic/basicassign1-before-analysis.il.expected b/src/test/incorrect/basicassign1/clang_no_plt_no_pic/basicassign1-before-analysis.il.expected deleted file mode 100644 index e26062499..000000000 --- a/src/test/incorrect/basicassign1/clang_no_plt_no_pic/basicassign1-before-analysis.il.expected +++ /dev/null @@ -1,315 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008b7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000943", condition()) - ) - ) - Block("1752:l00000943", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000951", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000096a", condition()) - ) - ) - Block("1764:l0000096a", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000951", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000095d", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008b7", condition()) - ) - ) - Block("1788:l000008b7", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b4c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007e1", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000bdd", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000007f7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000009ba", condition()) - ) - ) - Block("1604:l000007f7", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000009ba", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000083c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000099c", condition()) - ) - ) - Block("1640:l0000099c", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000083c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009af", condition()) - ) - ) - Block("1660:l0000083c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009af", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R9, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R9, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R10, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000878", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000097e", condition()) - ) - ) - Block("1700:l0000097e", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000878", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000991", condition()) - ) - ) - Block("1720:l00000878", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000991", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign1/clang_pic/basicassign1-before-analysis.il.expected b/src/test/incorrect/basicassign1/clang_pic/basicassign1-before-analysis.il.expected deleted file mode 100644 index d098569de..000000000 --- a/src/test/incorrect/basicassign1/clang_pic/basicassign1-before-analysis.il.expected +++ /dev/null @@ -1,317 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000035f", condition()) - ) - ) - Block("1816:l0000035f", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) - ), - jumps( - GoTo("1840:l0000036d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000386", condition()) - ) - ) - Block("1828:l00000386", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000036d", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000379", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002c5", condition()) - ) - ) - Block("1852:l000002c5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1944:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l0000050d", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001ef", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l000005a9", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003d6", condition()) - ) - ) - Block("1668:l00000205", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003d6", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003b8", condition()) - ) - ) - Block("1704:l000003b8", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003cb", condition()) - ) - ) - Block("1724:l0000024a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003cb", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4048bv64)])) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R9, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4032bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R10, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000039a", condition()) - ) - ) - Block("1764:l0000039a", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003ad", condition()) - ) - ) - Block("1784:l00000286", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003ad", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign1/gcc/basicassign1-before-analysis.il.expected b/src/test/incorrect/basicassign1/gcc/basicassign1-before-analysis.il.expected deleted file mode 100644 index 25b31daaf..000000000 --- a/src/test/incorrect/basicassign1/gcc/basicassign1-before-analysis.il.expected +++ /dev/null @@ -1,321 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000383", condition()) - ) - ) - Block("1752:l00000383", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000391", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003aa", condition()) - ) - ) - Block("1764:l000003aa", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000391", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000039d", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002d5", condition()) - ) - ) - Block("1788:l000002d5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1896:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000592", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001ff", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000629", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003fa", condition()) - ) - ) - Block("1604:l00000215", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003fa", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003dc", condition()) - ) - ) - Block("1640:l000003dc", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003ef", condition()) - ) - ) - Block("1660:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003ef", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003be", condition()) - ) - ) - Block("1700:l000003be", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003d1", condition()) - ) - ) - Block("1720:l00000296", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003d1", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign1/gcc_O2/basicassign1-before-analysis.il.expected b/src/test/incorrect/basicassign1/gcc_O2/basicassign1-before-analysis.il.expected deleted file mode 100644 index 640c488c3..000000000 --- a/src/test/incorrect/basicassign1/gcc_O2/basicassign1-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000322", condition()) - ) - ) - Block("1816:l00000322", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l00000330", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000349", condition()) - ) - ) - Block("1828:l00000349", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000330", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000033c", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f9", condition()) - ) - ) - Block("1852:l000002f9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l0000052c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000223", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005be", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000239", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000399", condition()) - ) - ) - Block("1668:l00000239", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000399", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000037b", condition()) - ) - ) - Block("1704:l0000037b", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l0000038e", condition()) - ) - ) - Block("1724:l0000027e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l0000038e", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R2, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 20bv64)] := Extract(Register(R2, bv64)[32:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000035d", condition()) - ) - ) - Block("1764:l0000035d", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000370", condition()) - ) - ) - Block("1784:l000002ba", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000370", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign1/gcc_no_plt_no_pic/basicassign1-before-analysis.il.expected b/src/test/incorrect/basicassign1/gcc_no_plt_no_pic/basicassign1-before-analysis.il.expected deleted file mode 100644 index e8383cfca..000000000 --- a/src/test/incorrect/basicassign1/gcc_no_plt_no_pic/basicassign1-before-analysis.il.expected +++ /dev/null @@ -1,321 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000915", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000009c3", condition()) - ) - ) - Block("1752:l000009c3", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000009d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009ea", condition()) - ) - ) - Block("1764:l000009ea", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000009d1", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009dd", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000915", condition()) - ) - ) - Block("1788:l00000915", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1896:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000bd2", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000083f", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c69", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000855", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a3a", condition()) - ) - ) - Block("1604:l00000855", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a3a", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000089a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000a1c", condition()) - ) - ) - Block("1640:l00000a1c", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000089a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a2f", condition()) - ) - ) - Block("1660:l0000089a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a2f", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008d6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009fe", condition()) - ) - ) - Block("1700:l000009fe", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000008d6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000a11", condition()) - ) - ) - Block("1720:l000008d6", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000a11", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign1/gcc_pic/basicassign1-before-analysis.il.expected b/src/test/incorrect/basicassign1/gcc_pic/basicassign1-before-analysis.il.expected deleted file mode 100644 index bbc12fe7b..000000000 --- a/src/test/incorrect/basicassign1/gcc_pic/basicassign1-before-analysis.il.expected +++ /dev/null @@ -1,321 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000387", condition()) - ) - ) - Block("1816:l00000387", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1840:l00000395", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l000003ae", condition()) - ) - ) - Block("1828:l000003ae", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000395", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000003a1", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002d5", condition()) - ) - ) - Block("1852:l000002d5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1960:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1960:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l00000535", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001ff", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l000005d5", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1668:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003fe", condition()) - ) - ) - Block("1668:l00000215", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003fe", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003e0", condition()) - ) - ) - Block("1704:l000003e0", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) - ), - jumps( - GoTo("1724:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003f3", condition()) - ) - ) - Block("1724:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003f3", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003c2", condition()) - ) - ) - Block("1764:l000003c2", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003d5", condition()) - ) - ) - Block("1784:l00000296", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003d5", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign2/clang/basicassign2-before-analysis.il.expected b/src/test/incorrect/basicassign2/clang/basicassign2-before-analysis.il.expected deleted file mode 100644 index d816d7b57..000000000 --- a/src/test/incorrect/basicassign2/clang/basicassign2-before-analysis.il.expected +++ /dev/null @@ -1,315 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000349", condition()) - ) - ) - Block("1752:l00000349", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000357", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000370", condition()) - ) - ) - Block("1764:l00000370", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000357", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000363", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002bd", condition()) - ) - ) - Block("1788:l000002bd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000552", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001e7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005e3", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003c0", condition()) - ) - ) - Block("1604:l000001fd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003c0", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003a2", condition()) - ) - ) - Block("1640:l000003a2", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003b5", condition()) - ) - ) - Block("1660:l00000242", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003b5", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R9, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv64)) - LocalAssign(Register(R10, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R9, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 64bv64)] := Register(R10, bv64))) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R8, bv64))) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 64bv64)] := Register(R8, bv64))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000384", condition()) - ) - ) - Block("1700:l00000384", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000397", condition()) - ) - ) - Block("1720:l0000027e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000397", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign2/clang_O2/basicassign2-before-analysis.il.expected b/src/test/incorrect/basicassign2/clang_O2/basicassign2-before-analysis.il.expected deleted file mode 100644 index 70cf214ec..000000000 --- a/src/test/incorrect/basicassign2/clang_O2/basicassign2-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002e5", condition()) - ) - ) - Block("1752:l000002e5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000030c", condition()) - ) - ) - Block("1764:l0000030c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002f3", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002ff", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000299", condition()) - ) - ) - Block("1788:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004e5", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000056d", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000035c", condition()) - ) - ) - Block("1604:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000035c", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000033e", condition()) - ) - ) - Block("1640:l0000033e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000351", condition()) - ) - ) - Block("1660:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000351", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 64bv64)] := Register(R8, bv64))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000320", condition()) - ) - ) - Block("1700:l00000320", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000333", condition()) - ) - ) - Block("1720:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000333", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign2/clang_no_plt_no_pic/basicassign2-before-analysis.il.expected b/src/test/incorrect/basicassign2/clang_no_plt_no_pic/basicassign2-before-analysis.il.expected deleted file mode 100644 index 40e77ac2f..000000000 --- a/src/test/incorrect/basicassign2/clang_no_plt_no_pic/basicassign2-before-analysis.il.expected +++ /dev/null @@ -1,315 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008b7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000943", condition()) - ) - ) - Block("1752:l00000943", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000951", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000096a", condition()) - ) - ) - Block("1764:l0000096a", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000951", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000095d", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008b7", condition()) - ) - ) - Block("1788:l000008b7", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b4c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007e1", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000bdd", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000007f7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000009ba", condition()) - ) - ) - Block("1604:l000007f7", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000009ba", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000083c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000099c", condition()) - ) - ) - Block("1640:l0000099c", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000083c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009af", condition()) - ) - ) - Block("1660:l0000083c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009af", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R9, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv64)) - LocalAssign(Register(R10, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R9, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 64bv64)] := Register(R10, bv64))) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R8, bv64))) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 64bv64)] := Register(R8, bv64))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000878", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000097e", condition()) - ) - ) - Block("1700:l0000097e", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000878", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000991", condition()) - ) - ) - Block("1720:l00000878", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000991", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign2/clang_pic/basicassign2-before-analysis.il.expected b/src/test/incorrect/basicassign2/clang_pic/basicassign2-before-analysis.il.expected deleted file mode 100644 index 1694434d4..000000000 --- a/src/test/incorrect/basicassign2/clang_pic/basicassign2-before-analysis.il.expected +++ /dev/null @@ -1,317 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000035f", condition()) - ) - ) - Block("1816:l0000035f", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) - ), - jumps( - GoTo("1840:l0000036d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000386", condition()) - ) - ) - Block("1828:l00000386", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000036d", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000379", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002c5", condition()) - ) - ) - Block("1852:l000002c5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1944:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l0000050d", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001ef", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l000005a9", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003d6", condition()) - ) - ) - Block("1668:l00000205", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003d6", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003b8", condition()) - ) - ) - Block("1704:l000003b8", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003cb", condition()) - ) - ) - Block("1724:l0000024a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003cb", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4048bv64)])) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R9, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv64)) - LocalAssign(Register(R10, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4032bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Register(R10, bv64))) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R8, bv64))) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Register(R8, bv64))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000039a", condition()) - ) - ) - Block("1764:l0000039a", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003ad", condition()) - ) - ) - Block("1784:l00000286", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003ad", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign2/gcc/basicassign2-before-analysis.il.expected b/src/test/incorrect/basicassign2/gcc/basicassign2-before-analysis.il.expected deleted file mode 100644 index 73cfc623a..000000000 --- a/src/test/incorrect/basicassign2/gcc/basicassign2-before-analysis.il.expected +++ /dev/null @@ -1,321 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000383", condition()) - ) - ) - Block("1752:l00000383", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000391", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003aa", condition()) - ) - ) - Block("1764:l000003aa", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000391", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000039d", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002d5", condition()) - ) - ) - Block("1788:l000002d5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1896:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000592", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001ff", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000629", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003fa", condition()) - ) - ) - Block("1604:l00000215", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003fa", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003dc", condition()) - ) - ) - Block("1640:l000003dc", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003ef", condition()) - ) - ) - Block("1660:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003ef", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 32bv64)) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv64)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Register(R1, bv64))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 32bv64)) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Register(R1, bv64))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003be", condition()) - ) - ) - Block("1700:l000003be", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003d1", condition()) - ) - ) - Block("1720:l00000296", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003d1", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign2/gcc_O2/basicassign2-before-analysis.il.expected b/src/test/incorrect/basicassign2/gcc_O2/basicassign2-before-analysis.il.expected deleted file mode 100644 index 095e1ac5c..000000000 --- a/src/test/incorrect/basicassign2/gcc_O2/basicassign2-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000322", condition()) - ) - ) - Block("1816:l00000322", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l00000330", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000349", condition()) - ) - ) - Block("1828:l00000349", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000330", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000033c", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f9", condition()) - ) - ) - Block("1852:l000002f9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l0000052c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000223", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005be", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000239", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000399", condition()) - ) - ) - Block("1668:l00000239", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000399", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000037b", condition()) - ) - ) - Block("1704:l0000037b", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l0000038e", condition()) - ) - ) - Block("1724:l0000027e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l0000038e", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 8bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 24bv64)] := Register(R2, bv64))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000035d", condition()) - ) - ) - Block("1764:l0000035d", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000370", condition()) - ) - ) - Block("1784:l000002ba", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000370", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign2/gcc_no_plt_no_pic/basicassign2-before-analysis.il.expected b/src/test/incorrect/basicassign2/gcc_no_plt_no_pic/basicassign2-before-analysis.il.expected deleted file mode 100644 index 356a5add9..000000000 --- a/src/test/incorrect/basicassign2/gcc_no_plt_no_pic/basicassign2-before-analysis.il.expected +++ /dev/null @@ -1,321 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000915", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000009c3", condition()) - ) - ) - Block("1752:l000009c3", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000009d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009ea", condition()) - ) - ) - Block("1764:l000009ea", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000009d1", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009dd", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000915", condition()) - ) - ) - Block("1788:l00000915", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1896:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000bd2", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000083f", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c69", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000855", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a3a", condition()) - ) - ) - Block("1604:l00000855", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a3a", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000089a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000a1c", condition()) - ) - ) - Block("1640:l00000a1c", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000089a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a2f", condition()) - ) - ) - Block("1660:l0000089a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a2f", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 32bv64)) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv64)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Register(R1, bv64))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 32bv64)) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Register(R1, bv64))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008d6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009fe", condition()) - ) - ) - Block("1700:l000009fe", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000008d6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000a11", condition()) - ) - ) - Block("1720:l000008d6", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000a11", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign2/gcc_pic/basicassign2-before-analysis.il.expected b/src/test/incorrect/basicassign2/gcc_pic/basicassign2-before-analysis.il.expected deleted file mode 100644 index c5ccf4508..000000000 --- a/src/test/incorrect/basicassign2/gcc_pic/basicassign2-before-analysis.il.expected +++ /dev/null @@ -1,321 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000387", condition()) - ) - ) - Block("1816:l00000387", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1840:l00000395", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l000003ae", condition()) - ) - ) - Block("1828:l000003ae", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000395", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000003a1", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002d5", condition()) - ) - ) - Block("1852:l000002d5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1960:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1960:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l00000535", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001ff", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l000005d5", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1668:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003fe", condition()) - ) - ) - Block("1668:l00000215", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003fe", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003e0", condition()) - ) - ) - Block("1704:l000003e0", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) - ), - jumps( - GoTo("1724:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003f3", condition()) - ) - ) - Block("1724:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003f3", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := 0bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Register(R1, bv64))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R0, bv64))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Register(R1, bv64))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003c2", condition()) - ) - ) - Block("1764:l000003c2", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003d5", condition()) - ) - ) - Block("1784:l00000296", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003d5", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign3/clang/basicassign3-before-analysis.il.expected b/src/test/incorrect/basicassign3/clang/basicassign3-before-analysis.il.expected deleted file mode 100644 index d9e01d499..000000000 --- a/src/test/incorrect/basicassign3/clang/basicassign3-before-analysis.il.expected +++ /dev/null @@ -1,315 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002bd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000349", condition()) - ) - ) - Block("1752:l00000349", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000357", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000370", condition()) - ) - ) - Block("1764:l00000370", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000357", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000363", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002bd", condition()) - ) - ) - Block("1788:l000002bd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000552", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001e7", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005e3", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001fd", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003c0", condition()) - ) - ) - Block("1604:l000001fd", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003c0", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003a2", condition()) - ) - ) - Block("1640:l000003a2", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000242", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003b5", condition()) - ) - ) - Block("1660:l00000242", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003b5", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 49bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R9, bv64)[8:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := 0bv8)) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) - LocalAssign(Register(R9, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 50bv64)] := Extract(Register(R10, bv64)[8:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 49bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 50bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000384", condition()) - ) - ) - Block("1700:l00000384", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000397", condition()) - ) - ) - Block("1720:l0000027e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000397", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign3/clang_O2/basicassign3-before-analysis.il.expected b/src/test/incorrect/basicassign3/clang_O2/basicassign3-before-analysis.il.expected deleted file mode 100644 index 637d9b559..000000000 --- a/src/test/incorrect/basicassign3/clang_O2/basicassign3-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000299", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000002e5", condition()) - ) - ) - Block("1752:l000002e5", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l000002f3", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000030c", condition()) - ) - ) - Block("1764:l0000030c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000002f3", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000002ff", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000299", condition()) - ) - ) - Block("1788:l00000299", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1836:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1836:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l000004e5", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001c3", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000056d", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000001d9", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l0000035c", condition()) - ) - ) - Block("1604:l000001d9", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l0000035c", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000033e", condition()) - ) - ) - Block("1640:l0000033e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000021e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000351", condition()) - ) - ) - Block("1660:l0000021e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000351", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 56bv64)] := Extract(Register(R8, bv64)[8:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000320", condition()) - ) - ) - Block("1700:l00000320", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000333", condition()) - ) - ) - Block("1720:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000333", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign3/clang_no_plt_no_pic/basicassign3-before-analysis.il.expected b/src/test/incorrect/basicassign3/clang_no_plt_no_pic/basicassign3-before-analysis.il.expected deleted file mode 100644 index a8deb5844..000000000 --- a/src/test/incorrect/basicassign3/clang_no_plt_no_pic/basicassign3-before-analysis.il.expected +++ /dev/null @@ -1,315 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008b7", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000943", condition()) - ) - ) - Block("1752:l00000943", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000951", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000096a", condition()) - ) - ) - Block("1764:l0000096a", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000951", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000095d", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008b7", condition()) - ) - ) - Block("1788:l000008b7", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1872:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b4c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007e1", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000bdd", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000007f7", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000009ba", condition()) - ) - ) - Block("1604:l000007f7", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000009ba", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000083c", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000099c", condition()) - ) - ) - Block("1640:l0000099c", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l0000083c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009af", condition()) - ) - ) - Block("1660:l0000083c", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009af", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 49bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R9, bv64)[8:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := 0bv8)) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) - LocalAssign(Register(R9, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 50bv64)] := Extract(Register(R10, bv64)[8:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 49bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R9, bv64), 50bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000878", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000097e", condition()) - ) - ) - Block("1700:l0000097e", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000878", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000991", condition()) - ) - ) - Block("1720:l00000878", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000991", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign3/clang_pic/basicassign3-before-analysis.il.expected b/src/test/incorrect/basicassign3/clang_pic/basicassign3-before-analysis.il.expected deleted file mode 100644 index c14c25df3..000000000 --- a/src/test/incorrect/basicassign3/clang_pic/basicassign3-before-analysis.il.expected +++ /dev/null @@ -1,317 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002c5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l0000035f", condition()) - ) - ) - Block("1816:l0000035f", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) - ), - jumps( - GoTo("1840:l0000036d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000386", condition()) - ) - ) - Block("1828:l00000386", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l0000036d", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l00000379", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002c5", condition()) - ) - ) - Block("1852:l000002c5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1944:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1944:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l0000050d", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001ef", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l000005a9", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1668:l00000205", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003d6", condition()) - ) - ) - Block("1668:l00000205", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003d6", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003b8", condition()) - ) - ) - Block("1704:l000003b8", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) - ), - jumps( - GoTo("1724:l0000024a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003cb", condition()) - ) - ) - Block("1724:l0000024a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003cb", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4048bv64)])) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R9, bv64)[8:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := 0bv8)) - LocalAssign(Register(R10, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) - LocalAssign(Register(R9, bv64) := 65536bv64) - LocalAssign(Register(R9, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R9, bv64), 4032bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R10, bv64)[8:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R9, bv64)] := Extract(Register(R8, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000039a", condition()) - ) - ) - Block("1764:l0000039a", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l00000286", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003ad", condition()) - ) - ) - Block("1784:l00000286", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003ad", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign3/gcc/basicassign3-before-analysis.il.expected b/src/test/incorrect/basicassign3/gcc/basicassign3-before-analysis.il.expected deleted file mode 100644 index bd725719e..000000000 --- a/src/test/incorrect/basicassign3/gcc/basicassign3-before-analysis.il.expected +++ /dev/null @@ -1,321 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000383", condition()) - ) - ) - Block("1752:l00000383", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000391", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003aa", condition()) - ) - ) - Block("1764:l000003aa", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000391", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000039d", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002d5", condition()) - ) - ) - Block("1788:l000002d5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1896:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000592", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001ff", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000629", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003fa", condition()) - ) - ) - Block("1604:l00000215", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003fa", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003dc", condition()) - ) - ) - Block("1640:l000003dc", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003ef", condition()) - ) - ) - Block("1660:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003ef", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 18bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := 0bv8)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 17bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 18bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 17bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003be", condition()) - ) - ) - Block("1700:l000003be", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003d1", condition()) - ) - ) - Block("1720:l00000296", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003d1", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign3/gcc_O2/basicassign3-before-analysis.il.expected b/src/test/incorrect/basicassign3/gcc_O2/basicassign3-before-analysis.il.expected deleted file mode 100644 index 44a5a14c3..000000000 --- a/src/test/incorrect/basicassign3/gcc_O2/basicassign3-before-analysis.il.expected +++ /dev/null @@ -1,306 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002f9", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000322", condition()) - ) - ) - Block("1816:l00000322", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1840:l00000330", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l00000349", condition()) - ) - ) - Block("1828:l00000349", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000330", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000033c", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002f9", condition()) - ) - ) - Block("1852:l000002f9", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1424:l0000052c", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1648:l00000223", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005be", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l00000239", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l00000399", condition()) - ) - ) - Block("1668:l00000239", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l00000399", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000037b", condition()) - ) - ) - Block("1704:l0000037b", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1724:l0000027e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l0000038e", condition()) - ) - ) - Block("1724:l0000027e", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l0000038e", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1536:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1536:lmain", - statements( - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R1, bv64), 17bv64)) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R2, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 1bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R1, bv64), 17bv64)] := Extract(Register(R2, bv64)[8:0]))) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l0000035d", condition()) - ) - ) - Block("1764:l0000035d", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002ba", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000370", condition()) - ) - ) - Block("1784:l000002ba", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000370", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign3/gcc_no_plt_no_pic/basicassign3-before-analysis.il.expected b/src/test/incorrect/basicassign3/gcc_no_plt_no_pic/basicassign3-before-analysis.il.expected deleted file mode 100644 index ecee37621..000000000 --- a/src/test/incorrect/basicassign3/gcc_no_plt_no_pic/basicassign3-before-analysis.il.expected +++ /dev/null @@ -1,321 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000915", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l000009c3", condition()) - ) - ) - Block("1752:l000009c3", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l000009d1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009ea", condition()) - ) - ) - Block("1764:l000009ea", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l000009d1", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009dd", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000915", condition()) - ) - ) - Block("1788:l00000915", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1896:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1896:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000bd2", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000083f", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c69", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000855", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a3a", condition()) - ) - ) - Block("1604:l00000855", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a3a", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000089a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000a1c", condition()) - ) - ) - Block("1640:l00000a1c", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000089a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000a2f", condition()) - ) - ) - Block("1660:l0000089a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000a2f", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 18bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := 0bv8)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 17bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 18bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 17bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008d6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009fe", condition()) - ) - ) - Block("1700:l000009fe", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000008d6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000a11", condition()) - ) - ) - Block("1720:l000008d6", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000a11", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/basicassign3/gcc_pic/basicassign3-before-analysis.il.expected b/src/test/incorrect/basicassign3/gcc_pic/basicassign3-before-analysis.il.expected deleted file mode 100644 index 786d1deaa..000000000 --- a/src/test/incorrect/basicassign3/gcc_pic/basicassign3-before-analysis.il.expected +++ /dev/null @@ -1,321 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002d5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000387", condition()) - ) - ) - Block("1816:l00000387", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1840:l00000395", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l000003ae", condition()) - ) - ) - Block("1828:l000003ae", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000395", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000003a1", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002d5", condition()) - ) - ) - Block("1852:l000002d5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1960:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1960:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#5, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#5, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#5, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#5, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l00000535", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l000001ff", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l000005d5", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1668:l00000215", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l000003fe", condition()) - ) - ) - Block("1668:l00000215", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l000003fe", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000003e0", condition()) - ) - ) - Block("1704:l000003e0", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) - ), - jumps( - GoTo("1724:l0000025a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l000003f3", condition()) - ) - ) - Block("1724:l0000025a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l000003f3", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := 0bv8)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 15bv64)] := Extract(Register(R0, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 15bv64)]), 56)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[8:0]))) - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000003c2", condition()) - ) - ) - Block("1764:l000003c2", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000003d5", condition()) - ) - ) - Block("1784:l00000296", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000003d5", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/iflocal/clang/iflocal-before-analysis.il.expected b/src/test/incorrect/iflocal/clang/iflocal-before-analysis.il.expected deleted file mode 100644 index 0f24183b2..000000000 --- a/src/test/incorrect/iflocal/clang/iflocal-before-analysis.il.expected +++ /dev/null @@ -1,363 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002c1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000036e", condition()) - ) - ) - Block("1752:l0000036e", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000037c", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000395", condition()) - ) - ) - Block("1764:l00000395", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000037c", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000388", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002c1", condition()) - ) - ) - Block("1788:l000002c1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000578", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001eb", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000062d", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000201", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003e5", condition()) - ) - ) - Block("1604:l00000201", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003e5", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000003c7", condition()) - ) - ) - Block("1640:l000003c7", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000246", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003da", condition()) - ) - ) - Block("1660:l00000246", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003da", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000334", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000337", condition()) - ) - ) - Block("?:l00000337", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l0000033a", condition()) - ) - ) - Block("?:l00000334", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l0000033a", condition()) - ) - ) - Block("?:l0000033a", - statements( - ), - jumps( - GoTo("1864:l00000342", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1848:l00000359", condition()) - ) - ) - Block("1848:l00000359", - statements( - ), - jumps( - GoTo("1852:l0000035a", condition()) - ) - ) - Block("1852:l0000035a", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1864:l00000342", condition()) - ) - ) - Block("1864:l00000342", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000003a9", condition()) - ) - ) - Block("1700:l000003a9", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000003bc", condition()) - ) - ) - Block("1720:l00000282", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000003bc", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/iflocal/clang_no_plt_no_pic/iflocal-before-analysis.il.expected b/src/test/incorrect/iflocal/clang_no_plt_no_pic/iflocal-before-analysis.il.expected deleted file mode 100644 index e82270699..000000000 --- a/src/test/incorrect/iflocal/clang_no_plt_no_pic/iflocal-before-analysis.il.expected +++ /dev/null @@ -1,363 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008e3", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000990", condition()) - ) - ) - Block("1752:l00000990", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000099e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009b7", condition()) - ) - ) - Block("1764:l000009b7", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000099e", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009aa", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008e3", condition()) - ) - ) - Block("1788:l000008e3", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b9a", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000080d", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c2c", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000823", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a07", condition()) - ) - ) - Block("1604:l00000823", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a07", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000868", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009e9", condition()) - ) - ) - Block("1640:l000009e9", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000868", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009fc", condition()) - ) - ) - Block("1660:l00000868", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009fc", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000956", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000959", condition()) - ) - ) - Block("?:l00000959", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l0000095c", condition()) - ) - ) - Block("?:l00000956", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l0000095c", condition()) - ) - ) - Block("?:l0000095c", - statements( - ), - jumps( - GoTo("1864:l00000964", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1848:l0000097b", condition()) - ) - ) - Block("1848:l0000097b", - statements( - ), - jumps( - GoTo("1852:l0000097c", condition()) - ) - ) - Block("1852:l0000097c", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1864:l00000964", condition()) - ) - ) - Block("1864:l00000964", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008a4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009cb", condition()) - ) - ) - Block("1700:l000009cb", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000008a4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009de", condition()) - ) - ) - Block("1720:l000008a4", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009de", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/iflocal/clang_pic/iflocal-before-analysis.il.expected b/src/test/incorrect/iflocal/clang_pic/iflocal-before-analysis.il.expected deleted file mode 100644 index e82270699..000000000 --- a/src/test/incorrect/iflocal/clang_pic/iflocal-before-analysis.il.expected +++ /dev/null @@ -1,363 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l000008e3", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000990", condition()) - ) - ) - Block("1752:l00000990", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l0000099e", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l000009b7", condition()) - ) - ) - Block("1764:l000009b7", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000099e", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l000009aa", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000008e3", condition()) - ) - ) - Block("1788:l000008e3", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1876:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1876:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b9a", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000080d", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000c2c", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000823", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000a07", condition()) - ) - ) - Block("1604:l00000823", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000a07", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000868", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000009e9", condition()) - ) - ) - Block("1640:l000009e9", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000868", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000009fc", condition()) - ) - ) - Block("1660:l00000868", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000009fc", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000956", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000959", condition()) - ) - ) - Block("?:l00000959", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l0000095c", condition()) - ) - ) - Block("?:l00000956", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l0000095c", condition()) - ) - ) - Block("?:l0000095c", - statements( - ), - jumps( - GoTo("1864:l00000964", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1848:l0000097b", condition()) - ) - ) - Block("1848:l0000097b", - statements( - ), - jumps( - GoTo("1852:l0000097c", condition()) - ) - ) - Block("1852:l0000097c", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1864:l00000964", condition()) - ) - ) - Block("1864:l00000964", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000008a4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000009cb", condition()) - ) - ) - Block("1700:l000009cb", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000008a4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000009de", condition()) - ) - ) - Block("1720:l000008a4", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000009de", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/iflocal/gcc/iflocal-before-analysis.il.expected b/src/test/incorrect/iflocal/gcc/iflocal-before-analysis.il.expected deleted file mode 100644 index 654735592..000000000 --- a/src/test/incorrect/iflocal/gcc/iflocal-before-analysis.il.expected +++ /dev/null @@ -1,330 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002b1", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l0000033a", condition()) - ) - ) - Block("1752:l0000033a", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000348", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000361", condition()) - ) - ) - Block("1764:l00000361", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000348", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000354", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002b1", condition()) - ) - ) - Block("1788:l000002b1", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1860:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1860:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000540", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000001db", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l000005f2", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000001f1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000003b1", condition()) - ) - ) - Block("1604:l000001f1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000003b1", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000236", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000393", condition()) - ) - ) - Block("1640:l00000393", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000236", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000003a6", condition()) - ) - ) - Block("1660:l00000236", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000003a6", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1848:l00000318", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1840:l0000032d", condition()) - ) - ) - Block("1840:l0000032d", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1848:l00000318", condition()) - ) - ) - Block("1848:l00000318", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000272", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000375", condition()) - ) - ) - Block("1700:l00000375", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000272", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000388", condition()) - ) - ) - Block("1720:l00000272", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000388", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/iflocal/gcc_no_plt_no_pic/iflocal-before-analysis.il.expected b/src/test/incorrect/iflocal/gcc_no_plt_no_pic/iflocal-before-analysis.il.expected deleted file mode 100644 index adeda0142..000000000 --- a/src/test/incorrect/iflocal/gcc_no_plt_no_pic/iflocal-before-analysis.il.expected +++ /dev/null @@ -1,330 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000898", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000921", condition()) - ) - ) - Block("1752:l00000921", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l0000092f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000948", condition()) - ) - ) - Block("1764:l00000948", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000092f", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000093b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000898", condition()) - ) - ) - Block("1788:l00000898", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1860:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1860:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b27", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007c2", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000bb5", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000007d8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000998", condition()) - ) - ) - Block("1604:l000007d8", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000998", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000081d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000097a", condition()) - ) - ) - Block("1640:l0000097a", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000081d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000098d", condition()) - ) - ) - Block("1660:l0000081d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000098d", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1848:l000008ff", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1840:l00000914", condition()) - ) - ) - Block("1840:l00000914", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1848:l000008ff", condition()) - ) - ) - Block("1848:l000008ff", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000859", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000095c", condition()) - ) - ) - Block("1700:l0000095c", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000859", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000096f", condition()) - ) - ) - Block("1720:l00000859", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000096f", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/iflocal/gcc_pic/iflocal-before-analysis.il.expected b/src/test/incorrect/iflocal/gcc_pic/iflocal-before-analysis.il.expected deleted file mode 100644 index adeda0142..000000000 --- a/src/test/incorrect/iflocal/gcc_pic/iflocal-before-analysis.il.expected +++ /dev/null @@ -1,330 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000898", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000921", condition()) - ) - ) - Block("1752:l00000921", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l0000092f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000948", condition()) - ) - ) - Block("1764:l00000948", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000092f", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000093b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000898", condition()) - ) - ) - Block("1788:l00000898", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1860:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1860:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#6, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#6, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#6, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#6, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000b27", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l000007c2", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000bb5", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l000007d8", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000998", condition()) - ) - ) - Block("1604:l000007d8", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000998", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000081d", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000097a", condition()) - ) - ) - Block("1640:l0000097a", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000081d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000098d", condition()) - ) - ) - Block("1660:l0000081d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000098d", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1848:l000008ff", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1840:l00000914", condition()) - ) - ) - Block("1840:l00000914", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1848:l000008ff", condition()) - ) - ) - Block("1848:l000008ff", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000859", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000095c", condition()) - ) - ) - Block("1700:l0000095c", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l00000859", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000096f", condition()) - ) - ) - Block("1720:l00000859", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000096f", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/nestedifglobal/clang/nestedifglobal-before-analysis.il.expected b/src/test/incorrect/nestedifglobal/clang/nestedifglobal-before-analysis.il.expected deleted file mode 100644 index c565ce58a..000000000 --- a/src/test/incorrect/nestedifglobal/clang/nestedifglobal-before-analysis.il.expected +++ /dev/null @@ -1,477 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000311", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000472", condition()) - ) - ) - Block("1752:l00000472", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000480", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000499", condition()) - ) - ) - Block("1764:l00000499", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000480", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000048c", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000311", condition()) - ) - ) - Block("1788:l00000311", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1956:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1956:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000690", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000023b", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l0000075b", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l00000251", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l000004e9", condition()) - ) - ) - Block("1604:l00000251", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l000004e9", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l000004cb", condition()) - ) - ) - Block("1640:l000004cb", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l00000296", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l000004de", condition()) - ) - ) - Block("1660:l00000296", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l000004de", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000390", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000393", condition()) - ) - ) - Block("?:l00000393", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000396", condition()) - ) - ) - Block("?:l00000390", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000396", condition()) - ) - ) - Block("?:l00000396", - statements( - ), - jumps( - GoTo("1872:l0000039e", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1856:l0000045d", condition()) - ) - ) - Block("1856:l0000045d", - statements( - ), - jumps( - GoTo("1860:l0000045e", condition()) - ) - ) - Block("1860:l0000045e", - statements( - LocalAssign(Register(R8, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1872:l0000039e", condition()) - ) - ) - Block("1872:l0000039e", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l000003ce", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l000003d1", condition()) - ) - ) - Block("?:l000003d1", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l000003d4", condition()) - ) - ) - Block("?:l000003ce", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l000003d4", condition()) - ) - ) - Block("?:l000003d4", - statements( - ), - jumps( - GoTo("1908:l000003dc", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1892:l00000448", condition()) - ) - ) - Block("1892:l00000448", - statements( - ), - jumps( - GoTo("1896:l00000449", condition()) - ) - ) - Block("1896:l00000449", - statements( - LocalAssign(Register(R8, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1908:l000003dc", condition()) - ) - ) - Block("1908:l000003dc", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) - LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000407", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l0000040a", condition()) - ) - ) - Block("?:l0000040a", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l0000040d", condition()) - ) - ) - Block("?:l00000407", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l0000040d", condition()) - ) - ) - Block("?:l0000040d", - statements( - ), - jumps( - GoTo("1944:l00000415", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1924:l0000042c", condition()) - ) - ) - Block("1924:l0000042c", - statements( - ), - jumps( - GoTo("1928:l0000042d", condition()) - ) - ) - Block("1928:l0000042d", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1944:l00000415", condition()) - ) - ) - Block("1944:l00000415", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000002d2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l000004ad", condition()) - ) - ) - Block("1700:l000004ad", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l000002d2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l000004c0", condition()) - ) - ) - Block("1720:l000002d2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l000004c0", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/nestedifglobal/clang_no_plt_no_pic/nestedifglobal-before-analysis.il.expected b/src/test/incorrect/nestedifglobal/clang_no_plt_no_pic/nestedifglobal-before-analysis.il.expected deleted file mode 100644 index f3f6460d8..000000000 --- a/src/test/incorrect/nestedifglobal/clang_no_plt_no_pic/nestedifglobal-before-analysis.il.expected +++ /dev/null @@ -1,477 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1788:l00000a61", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000bc2", condition()) - ) - ) - Block("1752:l00000bc2", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4040bv64)])) - ), - jumps( - GoTo("1776:l00000bd0", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000be9", condition()) - ) - ) - Block("1764:l00000be9", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000bd0", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000bdc", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l00000a61", condition()) - ) - ) - Block("1788:l00000a61", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1956:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1956:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000de0", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000098b", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000e86", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1604:l000009a1", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000c39", condition()) - ) - ) - Block("1604:l000009a1", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000c39", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l000009e6", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000c1b", condition()) - ) - ) - Block("1640:l00000c1b", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4032bv64)])) - ), - jumps( - GoTo("1660:l000009e6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000c2e", condition()) - ) - ) - Block("1660:l000009e6", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000c2e", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)]), 32)) - LocalAssign(Register(R8, bv64) := 69632bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R8, bv64), 52bv64)] := Extract(Register(R9, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000ae0", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000ae3", condition()) - ) - ) - Block("?:l00000ae3", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000ae6", condition()) - ) - ) - Block("?:l00000ae0", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000ae6", condition()) - ) - ) - Block("?:l00000ae6", - statements( - ), - jumps( - GoTo("1872:l00000aee", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1856:l00000bad", condition()) - ) - ) - Block("1856:l00000bad", - statements( - ), - jumps( - GoTo("1860:l00000bae", condition()) - ) - ) - Block("1860:l00000bae", - statements( - LocalAssign(Register(R8, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1872:l00000aee", condition()) - ) - ) - Block("1872:l00000aee", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 52bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000b1e", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000b21", condition()) - ) - ) - Block("?:l00000b21", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000b24", condition()) - ) - ) - Block("?:l00000b1e", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000b24", condition()) - ) - ) - Block("?:l00000b24", - statements( - ), - jumps( - GoTo("1908:l00000b2c", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1892:l00000b98", condition()) - ) - ) - Block("1892:l00000b98", - statements( - ), - jumps( - GoTo("1896:l00000b99", condition()) - ) - ) - Block("1896:l00000b99", - statements( - LocalAssign(Register(R8, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1908:l00000b2c", condition()) - ) - ) - Block("1908:l00000b2c", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 4bv64)]), 32)) - LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000b57", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000b5a", condition()) - ) - ) - Block("?:l00000b5a", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l00000b5d", condition()) - ) - ) - Block("?:l00000b57", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l00000b5d", condition()) - ) - ) - Block("?:l00000b5d", - statements( - ), - jumps( - GoTo("1944:l00000b65", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1924:l00000b7c", condition()) - ) - ) - Block("1924:l00000b7c", - statements( - ), - jumps( - GoTo("1928:l00000b7d", condition()) - ) - ) - Block("1928:l00000b7d", - statements( - LocalAssign(Register(R8, bv64) := 69632bv64) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 56bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 4bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1944:l00000b65", condition()) - ) - ) - Block("1944:l00000b65", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l00000a22", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000bfd", condition()) - ) - ) - Block("1700:l00000bfd", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1720:l00000a22", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000c10", condition()) - ) - ) - Block("1720:l00000a22", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000c10", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/nestedifglobal/clang_pic/nestedifglobal-before-analysis.il.expected b/src/test/incorrect/nestedifglobal/clang_pic/nestedifglobal-before-analysis.il.expected deleted file mode 100644 index 3960ef554..000000000 --- a/src/test/incorrect/nestedifglobal/clang_pic/nestedifglobal-before-analysis.il.expected +++ /dev/null @@ -1,480 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 48bv64)]), 56)) - ), - jumps( - GoTo("1852:l0000031d", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000496", condition()) - ) - ) - Block("1816:l00000496", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4024bv64)])) - ), - jumps( - GoTo("1840:l000004a4", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l000004bd", condition()) - ) - ) - Block("1828:l000004bd", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 40bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l000004a4", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l000004b0", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 48bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l0000031d", condition()) - ) - ) - Block("1852:l0000031d", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R16, bv64)])) - LocalAssign(Register(R16, bv64) := Register(R16, bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2032:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2032:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l00000644", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l00000247", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l000006f9", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1668:l0000025d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000050d", condition()) - ) - ) - Block("1668:l0000025d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000050d", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 69632bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 16bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l000002a2", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l000004ef", condition()) - ) - ) - Block("1704:l000004ef", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4016bv64)])) - ), - jumps( - GoTo("1724:l000002a2", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000502", condition()) - ) - ) - Block("1724:l000002a2", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000502", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4040bv64)])) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 8bv64)] := Register(R8, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 24bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R9, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 24bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R8, bv64)] := Extract(Register(R9, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := 0bv32)) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l000003ab", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l000003ae", condition()) - ) - ) - Block("?:l000003ae", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l000003b1", condition()) - ) - ) - Block("?:l000003ab", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l000003b1", condition()) - ) - ) - Block("?:l000003b1", - statements( - ), - jumps( - GoTo("1944:l000003b9", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1928:l00000481", condition()) - ) - ) - Block("1928:l00000481", - statements( - ), - jumps( - GoTo("1932:l00000482", condition()) - ) - ) - Block("1932:l00000482", - statements( - LocalAssign(Register(R8, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1944:l000003b9", condition()) - ) - ) - Block("1944:l000003b9", - statements( - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l000003eb", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l000003ee", condition()) - ) - ) - Block("?:l000003ee", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l000003f1", condition()) - ) - ) - Block("?:l000003eb", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l000003f1", condition()) - ) - ) - Block("?:l000003f1", - statements( - ), - jumps( - GoTo("1980:l000003f9", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1964:l0000046c", condition()) - ) - ) - Block("1964:l0000046c", - statements( - ), - jumps( - GoTo("1968:l0000046d", condition()) - ) - ) - Block("1968:l0000046d", - statements( - LocalAssign(Register(R8, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("1980:l000003f9", condition()) - ) - ) - Block("1980:l000003f9", - statements( - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 20bv64)]), 32)) - LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R8, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R8, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R8, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) - LocalAssign(Register(R8, bv64) := ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 32)) - ), - jumps( - GoTo("?:l00000424", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("?:l00000427", condition()) - ) - ) - Block("?:l00000427", - statements( - LocalAssign(Register(R8, bv64) := 1bv64) - ), - jumps( - GoTo("?:l0000042a", condition()) - ) - ) - Block("?:l00000424", - statements( - LocalAssign(Register(R8, bv64) := 0bv64) - ), - jumps( - GoTo("?:l0000042a", condition()) - ) - ) - Block("?:l0000042a", - statements( - ), - jumps( - GoTo("2020:l00000432", condition(BinaryExpr("!=", BinaryExpr("comp", Extract(Register(R8, bv64)[1:0]), 1bv1), 0bv1))) - GoTo("1996:l00000449", condition()) - ) - ) - Block("1996:l00000449", - statements( - ), - jumps( - GoTo("2000:l0000044a", condition()) - ) - ) - Block("2000:l0000044a", - statements( - LocalAssign(Register(R8, bv64) := 65536bv64) - LocalAssign(Register(R8, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R8, bv64), 4032bv64)])) - LocalAssign(Register(R8, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R8, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 20bv64)] := Extract(Register(R8, bv64)[32:0]))) - ), - jumps( - GoTo("2020:l00000432", condition()) - ) - ) - Block("2020:l00000432", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 48bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002de", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l000004d1", condition()) - ) - ) - Block("1764:l000004d1", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4064bv64)])) - ), - jumps( - GoTo("1784:l000002de", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l000004e4", condition()) - ) - ) - Block("1784:l000002de", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l000004e4", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/nestedifglobal/gcc/nestedifglobal-before-analysis.il.expected b/src/test/incorrect/nestedifglobal/gcc/nestedifglobal-before-analysis.il.expected deleted file mode 100644 index 2666463d8..000000000 --- a/src/test/incorrect/nestedifglobal/gcc/nestedifglobal-before-analysis.il.expected +++ /dev/null @@ -1,385 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000002fd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000421", condition()) - ) - ) - Block("1752:l00000421", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l0000042f", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000448", condition()) - ) - ) - Block("1764:l00000448", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l0000042f", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l0000043b", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000002fd", condition()) - ) - ) - Block("1788:l000002fd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1936:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1936:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l0000063a", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l00000227", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000703", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l0000023d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000498", condition()) - ) - ) - Block("1604:l0000023d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000498", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l0000047a", condition()) - ) - ) - Block("1640:l0000047a", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l0000048d", condition()) - ) - ) - Block("1660:l00000282", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l0000048d", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1868:l00000381", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1860:l00000414", condition()) - ) - ) - Block("1860:l00000414", - statements( - LocalAssign(Register(R0, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1868:l00000381", condition()) - ) - ) - Block("1868:l00000381", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1896:l000003b2", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1888:l00000407", condition()) - ) - ) - Block("1888:l00000407", - statements( - LocalAssign(Register(R0, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1896:l000003b2", condition()) - ) - ) - Block("1896:l000003b2", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1924:l000003d8", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1908:l000003ed", condition()) - ) - ) - Block("1908:l000003ed", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1924:l000003d8", condition()) - ) - ) - Block("1924:l000003d8", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l0000045c", condition()) - ) - ) - Block("1700:l0000045c", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l0000046f", condition()) - ) - ) - Block("1720:l000002be", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l0000046f", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/nestedifglobal/gcc_no_plt_no_pic/nestedifglobal-before-analysis.il.expected b/src/test/incorrect/nestedifglobal/gcc_no_plt_no_pic/nestedifglobal-before-analysis.il.expected deleted file mode 100644 index 89df1eaa9..000000000 --- a/src/test/incorrect/nestedifglobal/gcc_no_plt_no_pic/nestedifglobal-before-analysis.il.expected +++ /dev/null @@ -1,385 +0,0 @@ -Procedure("1488:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1728:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1788:l000009f5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1752:l00000b19", condition()) - ) - ) - Block("1752:l00000b19", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - ), - jumps( - GoTo("1776:l00000b27", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000b40", condition()) - ) - ) - Block("1764:l00000b40", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1776bv64) - ), - jumps( - DirectCall("1488:__cxa_finalize", condition()) - ) - ) - Block("1776:l00000b27", - statements( - LocalAssign(Register(R30, bv64) := 1780bv64) - ), - jumps( - DirectCall("1616:deregister_tm_clones", condition()) - ) - ) - Block("1780:l00000b33", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1788:l000009f5", condition()) - ) - ) - Block("1788:l000009f5", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1472:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1472:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1936:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1936:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1408:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1408:l_init", - statements( - LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1424bv64) - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) - Block("1424:l00000d32", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1536:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1536:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1584bv64) - ), - jumps( - DirectCall("1472:__libc_start_main", condition()) - ) - ) - Block("1584:l0000091f", - statements( - LocalAssign(Register(R30, bv64) := 1588bv64) - ), - jumps( - DirectCall("1520:abort", condition()) - ) - ) - Block("?:l00000dd3", - statements( - ), - jumps( - DirectCall("1588:call_weak_fn", condition()) - ) - ) -)), -Procedure("1520:abort", in(), out(), blocks( -)), -Procedure("1588:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1588:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1604:l00000935", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1600:l00000b90", condition()) - ) - ) - Block("1604:l00000935", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1600:l00000b90", - statements( - ), - jumps( - GoTo("1504:l__gmon_start__", condition()) - ) - ) - Block("1504:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4032bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4032bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1616:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1616:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1660:l0000097a", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1640:l00000b72", condition()) - ) - ) - Block("1640:l00000b72", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4056bv64)])) - ), - jumps( - GoTo("1660:l0000097a", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1652:l00000b85", condition()) - ) - ) - Block("1660:l0000097a", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1652:l00000b85", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1808:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1808:lframe_dummy", - statements( - ), - jumps( - DirectCall("1664:register_tm_clones", condition()) - ) - ) -)), -Procedure("1812:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1812:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1868:l00000a79", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1860:l00000b0c", condition()) - ) - ) - Block("1860:l00000b0c", - statements( - LocalAssign(Register(R0, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1868:l00000a79", condition()) - ) - ) - Block("1868:l00000a79", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 20bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1896:l00000aaa", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1888:l00000aff", condition()) - ) - ) - Block("1888:l00000aff", - statements( - LocalAssign(Register(R0, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1896:l00000aaa", condition()) - ) - ) - Block("1896:l00000aaa", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1924:l00000ad0", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1908:l00000ae5", condition()) - ) - ) - Block("1908:l00000ae5", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 24bv64)) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1924:l00000ad0", condition()) - ) - ) - Block("1924:l00000ad0", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1664:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1664:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1720:l000009b6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1700:l00000b54", condition()) - ) - ) - Block("1700:l00000b54", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1720:l000009b6", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1712:l00000b67", condition()) - ) - ) - Block("1720:l000009b6", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1712:l00000b67", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), diff --git a/src/test/incorrect/nestedifglobal/gcc_pic/nestedifglobal-before-analysis.il.expected b/src/test/incorrect/nestedifglobal/gcc_pic/nestedifglobal-before-analysis.il.expected deleted file mode 100644 index ee9e8fa86..000000000 --- a/src/test/incorrect/nestedifglobal/gcc_pic/nestedifglobal-before-analysis.il.expected +++ /dev/null @@ -1,385 +0,0 @@ -Procedure("1536:__cxa_finalize", in(), out(Parameter(Register(R0, bv64))), blocks( -)), -Procedure("1792:__do_global_dtors_aux", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1792:l__do_global_dtors_aux", - statements( - LocalAssign(LocalVar(#3, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#3, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#3, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#3, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 16bv64)] := Register(R19, bv64))) - LocalAssign(Register(R19, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R19, bv64), 16bv64)]), 56)) - ), - jumps( - GoTo("1852:l000002fd", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", Extract(Register(R0, bv64)[32:0]), 0bv32)), 0bv1))) - GoTo("1816:l00000425", condition()) - ) - ) - Block("1816:l00000425", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4048bv64)])) - ), - jumps( - GoTo("1840:l00000433", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1828:l0000044c", condition()) - ) - ) - Block("1828:l0000044c", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 8bv64)])) - LocalAssign(Register(R30, bv64) := 1840bv64) - ), - jumps( - DirectCall("1536:__cxa_finalize", condition()) - ) - ) - Block("1840:l00000433", - statements( - LocalAssign(Register(R30, bv64) := 1844bv64) - ), - jumps( - DirectCall("1680:deregister_tm_clones", condition()) - ) - ) - Block("1844:l0000043f", - statements( - LocalAssign(Register(R0, bv64) := 1bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R19, bv64), 16bv64)] := Extract(Register(R0, bv64)[8:0]))) - ), - jumps( - GoTo("1852:l000002fd", condition()) - ) - ) - Block("1852:l000002fd", - statements( - LocalAssign(Register(R19, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 16bv64)])) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1520:__libc_start_main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64)), Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64))), out(Parameter(Register(R2, bv64)), Parameter(Register(R3, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1520:l__libc_start_main", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4000bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4000bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("2000:_fini", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("2000:l_fini", - statements( - LocalAssign(LocalVar(#0, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#0, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#0, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#0, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1456:_init", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1456:l_init", - statements( - LocalAssign(LocalVar(#8, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551600bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[LocalVar(#8, bv64)] := Register(R29, bv64))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", LocalVar(#8, bv64), 8bv64)] := Register(R30, bv64))) - LocalAssign(Register(R31, bv64) := LocalVar(#8, bv64)) - LocalAssign(Register(R29, bv64) := Register(R31, bv64)) - LocalAssign(Register(R30, bv64) := 1472bv64) - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) - Block("1472:l000005d3", - statements( - LocalAssign(Register(R29, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R30, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 8bv64)])) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 16bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1600:_start", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1600:l_start", - statements( - LocalAssign(Register(R29, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 0bv64) - LocalAssign(Register(R5, bv64) := Register(R0, bv64)) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [Register(R31, bv64)])) - LocalAssign(Register(R2, bv64) := BinaryExpr("add", Register(R31, bv64), 8bv64)) - LocalAssign(Register(R6, bv64) := Register(R31, bv64)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4080bv64)])) - LocalAssign(Register(R3, bv64) := 0bv64) - LocalAssign(Register(R4, bv64) := 0bv64) - LocalAssign(Register(R30, bv64) := 1648bv64) - ), - jumps( - DirectCall("1520:__libc_start_main", condition()) - ) - ) - Block("1648:l00000227", - statements( - LocalAssign(Register(R30, bv64) := 1652bv64) - ), - jumps( - DirectCall("1568:abort", condition()) - ) - ) - Block("?:l00000683", - statements( - ), - jumps( - DirectCall("1652:call_weak_fn", condition()) - ) - ) -)), -Procedure("1568:abort", in(), out(), blocks( -)), -Procedure("1652:call_weak_fn", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1652:lcall_weak_fn", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4072bv64)])) - ), - jumps( - GoTo("1668:l0000023d", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R0, bv64), 0bv64), 0bv1))) - GoTo("1664:l0000049c", condition()) - ) - ) - Block("1668:l0000023d", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1664:l0000049c", - statements( - ), - jumps( - GoTo("1552:l__gmon_start__", condition()) - ) - ) - Block("1552:l__gmon_start__", - statements( - LocalAssign(Register(R16, bv64) := 65536bv64) - LocalAssign(Register(R17, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R16, bv64), 4016bv64)])) - LocalAssign(Register(R16, bv64) := BinaryExpr("add", Register(R16, bv64), 4016bv64)) - ), - jumps( - IndirectCall(Register(R17, bv64), condition()) - ) - ) -)), -Procedure("1680:deregister_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1680:lderegister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(LocalVar(#1, bv64) := UnaryExpr("not", Register(R0, bv64))) - LocalAssign(LocalVar(#2, bv64) := BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64)))) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", SignExtend(Register(R1, bv64), 1), SignExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 1), BinaryExpr("add", BinaryExpr("add", ZeroExtend(Register(R1, bv64), 1), ZeroExtend(LocalVar(#1, bv64), 1)), 1bv65)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#2, bv64), 1bv64), 0bv64)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#2, bv64), 1bv64)[64:63])) - ), - jumps( - GoTo("1724:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1), 0bv1))) - GoTo("1704:l0000047e", condition()) - ) - ) - Block("1704:l0000047e", - statements( - LocalAssign(Register(R1, bv64) := 65536bv64) - LocalAssign(Register(R1, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R1, bv64), 4040bv64)])) - ), - jumps( - GoTo("1724:l00000282", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1716:l00000491", condition()) - ) - ) - Block("1724:l00000282", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1716:l00000491", - statements( - LocalAssign(Register(R16, bv64) := Register(R1, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), -Procedure("1872:frame_dummy", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1872:lframe_dummy", - statements( - ), - jumps( - DirectCall("1728:register_tm_clones", condition()) - ) - ) -)), -Procedure("1876:main", in(Parameter(Register(R0, bv64)), Parameter(Register(R1, bv64))), out(Parameter(Register(R1, bv64)), Parameter(Register(R0, bv64))), blocks( - Block("1876:lmain", - statements( - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 18446744073709551584bv64)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 12bv64)] := Extract(Register(R0, bv64)[32:0]))) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R1, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 12bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[Register(R0, bv64)] := Extract(Register(R1, bv64)[32:0]))) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := 0bv32)) - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#4, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967295bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 0bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967296bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#4, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#4, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1932:l00000383", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1924:l00000418", condition()) - ) - ) - Block("1924:l00000418", - statements( - LocalAssign(Register(R0, bv64) := 3bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1932:l00000383", condition()) - ) - ) - Block("1932:l00000383", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4064bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - LocalAssign(LocalVar(#5, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967294bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934591bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967295bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#5, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#5, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1960:l000003b5", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1952:l0000040b", condition()) - ) - ) - Block("1952:l0000040b", - statements( - LocalAssign(Register(R0, bv64) := 5bv64) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1960:l000003b5", condition()) - ) - ) - Block("1960:l000003b5", - statements( - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R31, bv64), 28bv64)]), 32)) - LocalAssign(LocalVar(#6, bv32) := BinaryExpr("add", Extract(Register(R0, bv64)[32:0]), 4294967292bv32)) - LocalAssign(LocalVar(VF, bv1) := UnaryExpr("not", BinaryExpr("comp", SignExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", SignExtend(Extract(Register(R0, bv64)[32:0]), 1), 8589934589bv33)))) - LocalAssign(LocalVar(CF, bv1) := UnaryExpr("not", BinaryExpr("comp", ZeroExtend(BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 1), BinaryExpr("add", ZeroExtend(Extract(Register(R0, bv64)[32:0]), 1), 4294967293bv33)))) - LocalAssign(LocalVar(ZF, bv1) := BinaryExpr("comp", BinaryExpr("add", LocalVar(#6, bv32), 1bv32), 0bv32)) - LocalAssign(LocalVar(NF, bv1) := Extract(BinaryExpr("add", LocalVar(#6, bv32), 1bv32)[32:31])) - ), - jumps( - GoTo("1988:l000003db", condition(BinaryExpr("!=", UnaryExpr("not", BinaryExpr("comp", LocalVar(ZF, bv1), 1bv1)), 0bv1))) - GoTo("1972:l000003f0", condition()) - ) - ) - Block("1972:l000003f0", - statements( - LocalAssign(Register(R0, bv64) := 65536bv64) - LocalAssign(Register(R0, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R0, bv64), 4056bv64)])) - LocalAssign(Register(R0, bv64) := ZeroExtend(MemoryLoad(Memory("mem", 64, 8), [Register(R0, bv64)]), 32)) - MemoryAssign(MemoryStore(Memory("mem", 64, 8)[BinaryExpr("add", Register(R31, bv64), 28bv64)] := Extract(Register(R0, bv64)[32:0]))) - ), - jumps( - GoTo("1988:l000003db", condition()) - ) - ) - Block("1988:l000003db", - statements( - LocalAssign(Register(R0, bv64) := 0bv64) - LocalAssign(Register(R31, bv64) := BinaryExpr("add", Register(R31, bv64), 32bv64)) - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) -)), -Procedure("1728:register_tm_clones", in(), out(Parameter(Register(R0, bv64))), blocks( - Block("1728:lregister_tm_clones", - statements( - LocalAssign(Register(R0, bv64) := 69632bv64) - LocalAssign(Register(R0, bv64) := BinaryExpr("add", Register(R0, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := 69632bv64) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R1, bv64), 16bv64)) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", BinaryExpr("add", Register(R1, bv64), UnaryExpr("not", Register(R0, bv64))), 1bv64)) - LocalAssign(Register(R2, bv64) := BinaryExpr("++", 0bv63, Extract(Register(R1, bv64)[64:63]))) - LocalAssign(Register(R1, bv64) := BinaryExpr("add", Register(R2, bv64), BinaryExpr("ashr", Register(R1, bv64), ZeroExtend(3bv3, 61)))) - LocalAssign(Register(R1, bv64) := SignExtend(Extract(Register(R1, bv64)[64:1]), 1)) - ), - jumps( - GoTo("1784:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R1, bv64), 0bv64), 0bv1))) - GoTo("1764:l00000460", condition()) - ) - ) - Block("1764:l00000460", - statements( - LocalAssign(Register(R2, bv64) := 65536bv64) - LocalAssign(Register(R2, bv64) := MemoryLoad(Memory("mem", 64, 8), [BinaryExpr("add", Register(R2, bv64), 4088bv64)])) - ), - jumps( - GoTo("1784:l000002be", condition(BinaryExpr("!=", BinaryExpr("comp", Register(R2, bv64), 0bv64), 0bv1))) - GoTo("1776:l00000473", condition()) - ) - ) - Block("1784:l000002be", - statements( - ), - jumps( - IndirectCall(Register(R30, bv64), condition()) - ) - ) - Block("1776:l00000473", - statements( - LocalAssign(Register(R16, bv64) := Register(R2, bv64)) - ), - jumps( - IndirectCall(Register(R16, bv64), condition()) - ) - ) -)), From cbf547df1837ceb589883296f6b1892ce9a28903 Mon Sep 17 00:00:00 2001 From: l-kent Date: Wed, 1 Nov 2023 14:33:13 +1000 Subject: [PATCH 19/20] make summary give more useful information --- src/test/scala/SystemTests.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/scala/SystemTests.scala b/src/test/scala/SystemTests.scala index 8d746ca4d..c181d6bc5 100644 --- a/src/test/scala/SystemTests.scala +++ b/src/test/scala/SystemTests.scala @@ -53,20 +53,20 @@ class SystemTests extends AnyFunSuite { val csv: String = "testCase," + TestResult.csvHeader + System.lineSeparator() + testResults.map(r => s"${r._1},${r._2.toCsv}").mkString(System.lineSeparator()) log(csv, testPath + "testResults.csv") - val numVerified = testResults.count(_._2.verified) - val numNotVerified = testResults.count(!_._2.verified) + val numSuccess = testResults.count(_._2.passed) + val numFail = testResults.count(!_._2.passed) val numTimeout = testResults.count(_._2.timedOut) val verifying = testResults.filter(x => !x._2.timedOut && x._2.verified).map(_._2.verifyTime) val counterExamples = testResults.filter(x => !x._2.timedOut && !x._2.verified).map(_._2.verifyTime) - info(s"Test summary: $numVerified verified, $numNotVerified failed to verify including $numTimeout timeouts.") + info(s"Test summary: $numSuccess succeeded, $numFail failed (including $numTimeout timeouts).") if (verifying.nonEmpty) info(s"Average time to verify: ${verifying.sum / verifying.size}") if (counterExamples.nonEmpty) info(s"Average time to counterexample: ${counterExamples.sum/ counterExamples.size}") val summaryHeader = "verifiedCount,counterexampleCount,timeoutCount,verifyTotalTime,counterexampleTotalTime" - val summaryRow = s"$numVerified,${counterExamples.size},$numTimeout,${verifying.sum},${counterExamples.sum}" + val summaryRow = s"$numSuccess,${counterExamples.size},$numTimeout,${verifying.sum},${counterExamples.sum}" log(summaryHeader + System.lineSeparator() + summaryRow, testPath + "summary.csv") } From e9b5b0a59fcf2b7afd8013fa07eb1b5c00813910 Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Wed, 1 Nov 2023 16:33:08 +1000 Subject: [PATCH 20/20] add num verify/failed to summary --- src/test/scala/SystemTests.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/test/scala/SystemTests.scala b/src/test/scala/SystemTests.scala index c181d6bc5..8525be73b 100644 --- a/src/test/scala/SystemTests.scala +++ b/src/test/scala/SystemTests.scala @@ -53,20 +53,22 @@ class SystemTests extends AnyFunSuite { val csv: String = "testCase," + TestResult.csvHeader + System.lineSeparator() + testResults.map(r => s"${r._1},${r._2.toCsv}").mkString(System.lineSeparator()) log(csv, testPath + "testResults.csv") + val numVerified = testResults.count(_._2.verified) + val numCounterexample = testResults.count(x => !x._2.verified && !x._2.timedOut) val numSuccess = testResults.count(_._2.passed) val numFail = testResults.count(!_._2.passed) val numTimeout = testResults.count(_._2.timedOut) val verifying = testResults.filter(x => !x._2.timedOut && x._2.verified).map(_._2.verifyTime) val counterExamples = testResults.filter(x => !x._2.timedOut && !x._2.verified).map(_._2.verifyTime) - info(s"Test summary: $numSuccess succeeded, $numFail failed (including $numTimeout timeouts).") + info(s"Test summary: $numSuccess succeeded, $numFail failed: $numVerified verified, $numCounterexample did not verify (including $numTimeout timeouts).") if (verifying.nonEmpty) info(s"Average time to verify: ${verifying.sum / verifying.size}") if (counterExamples.nonEmpty) info(s"Average time to counterexample: ${counterExamples.sum/ counterExamples.size}") - val summaryHeader = "verifiedCount,counterexampleCount,timeoutCount,verifyTotalTime,counterexampleTotalTime" - val summaryRow = s"$numSuccess,${counterExamples.size},$numTimeout,${verifying.sum},${counterExamples.sum}" + val summaryHeader = "passedCount,failedCount,verifiedCount,counterexampleCount,timeoutCount,verifyTotalTime,counterexampleTotalTime" + val summaryRow = s"$numSuccess,$numFail,$numVerified,${counterExamples.size},$numTimeout,${verifying.sum},${counterExamples.sum}" log(summaryHeader + System.lineSeparator() + summaryRow, testPath + "summary.csv") }